diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index a7d1a54a8..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 - -updates: - - package-ecosystem: github-actions - directory: / - labels: ["no changelog", "merge when ready", "dependencies", "github_actions"] - schedule: - interval: weekly - - - package-ecosystem: npm - directory: / - labels: ["no changelog", "merge when ready", "dependencies", "javascript"] - schedule: - interval: monthly diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea970bcad..2a795c01f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: GOPATH: /home/runner/go steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 @@ -30,12 +30,12 @@ jobs: echo "version=${GO_VERSION}" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 with: go-version: ${{ steps.go_version.outputs.version }} - name: Cache Godel assets - uses: actions/cache@v5 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.godel key: ${{ runner.os }}-godel-${{ hashFiles('godelw', 'godel/config/godel.yml') }} @@ -54,7 +54,7 @@ jobs: GOPATH: /home/runner/go steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 @@ -65,12 +65,12 @@ jobs: echo "version=${GO_VERSION}" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 with: go-version: ${{ steps.go_version.outputs.version }} - name: Cache Godel assets - uses: actions/cache@v5 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.godel key: ${{ runner.os }}-godel-${{ hashFiles('godelw', 'godel/config/godel.yml') }} @@ -78,12 +78,12 @@ jobs: ${{ runner.os }}-godel- - name: Set up Node - uses: actions/setup-node@v6 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: 20 - name: Cache node_modules - uses: actions/cache@v5 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: node_modules key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} @@ -103,7 +103,7 @@ jobs: run: ./godelw docker build --verbose - name: Archive distribution - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: dist path: | @@ -113,26 +113,16 @@ jobs: # Steps after this point should only run when publishing # Include them here to avoid exporting the Docker container as an artifact # - - - name: Login to Docker Hub - if: ${{ github.event_name == 'push' || github.event_name == 'release' }} - uses: docker/login-action@v4 + - name: Login to GCR + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Push snapshot image to Docker Hub - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} - run: ./godelw docker push --tags=snapshot + registry: gcr.io + username: _json_key + password: ${{ secrets.GCR_JSON_KEY }} - - name: Push release image to Docker Hub - if: ${{ github.event_name == 'release' }} + - name: Push release image to gcr run: ./godelw docker push --tags=latest,version - - name: Publish release assets - if: ${{ github.event_name == 'release' }} - run: ./godelw publish github --add-v-prefix --api-url=${GITHUB_API_URL} --user=palantir --repository=policy-bot --token=${{ secrets.GITHUB_TOKEN }} - ci-all: runs-on: ubuntu-latest if: ${{ !cancelled() }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index b70e5eb90..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] - schedule: - - cron: '25 12 * * 1' - -jobs: - analyze: - permissions: - security-events: write - - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'go', 'javascript' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - with: - languages: ${{ matrix.language }} - - - name: Set Go version - id: go_version - run: | - GO_VERSION=$(sed -E -n '/^go / s/^go ([0-9]+\.[0-9]+)(\.[0-9]+)?$/\1/p' < go.mod) - echo "version=${GO_VERSION}" >> $GITHUB_OUTPUT - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: ${{ steps.go_version.outputs.version }} - - - name: Autobuild for CodeQL - uses: github/codeql-action/autobuild@v4 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 diff --git a/.gitignore b/.gitignore index 4b990b850..fea177441 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ gotest.out # default config location config/policy-bot.yml +.opencode + +.claude/settings.local.json diff --git a/README.md b/README.md index 3e059b825..f41234b97 100644 --- a/README.md +++ b/README.md @@ -657,6 +657,12 @@ requires: organizations: ["org1", "org2"] teams: ["org1/team1", "org2/team2"] + # If true, the codeowners of the changed files (as defined in the + # repository's CODEOWNERS file) are considered valid approvers. The + # CODEOWNERS file is read from .github/CODEOWNERS, CODEOWNERS, or + # docs/CODEOWNERS in the repository. + codeowners: true + # A user must have at least the minimum permission in this list for their # approval to count for this rule. Valid permissions are "admin", "maintain", # "write", "triage", and "read". diff --git a/config/policy-examples/codeowners-approval.yml b/config/policy-examples/codeowners-approval.yml new file mode 100644 index 000000000..24b39dbc8 --- /dev/null +++ b/config/policy-examples/codeowners-approval.yml @@ -0,0 +1,13 @@ +# This policy requires at least one approval from a codeowner of the +# changed files. Codeowners are determined from the repository's +# CODEOWNERS file (.github/CODEOWNERS, CODEOWNERS, or docs/CODEOWNERS). + +policy: + approval: + - a codeowner has approved + +approval_rules: +- name: a codeowner has approved + requires: + count: 1 + codeowners: true diff --git a/go.mod b/go.mod index 1c6c4e939..88108d30d 100644 --- a/go.mod +++ b/go.mod @@ -9,15 +9,16 @@ require ( github.com/bmatcuk/doublestar/v4 v4.10.0 github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500 github.com/die-net/lrucache v0.0.0-20240714232319-26322ba4bc23 - github.com/google/go-github/v82 v82.0.0 + github.com/google/go-github/v85 v85.0.0 github.com/google/go-querystring v1.2.0 github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 + github.com/hairyhenderson/go-codeowners v0.7.0 github.com/hashicorp/golang-lru v1.0.2 - github.com/palantir/go-baseapp v0.6.0 - github.com/palantir/go-githubapp v0.41.0 + github.com/palantir/go-baseapp v0.7.0 + github.com/palantir/go-githubapp v0.44.0 github.com/pkg/errors v0.9.1 github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 - github.com/rs/zerolog v1.35.0 + github.com/rs/zerolog v1.35.1 github.com/shurcooL/githubv4 v0.0.0-20260209031235-2402fdf4a9ed github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 @@ -36,9 +37,8 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/google/go-github/v84 v84.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-isatty v0.0.22 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -51,9 +51,9 @@ require ( github.com/shurcooL/graphql v0.0.0-20240915155400-7ee5256398cf // indirect github.com/spf13/pflag v1.0.10 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect - golang.org/x/crypto v0.49.0 // indirect + golang.org/x/crypto v0.52.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.42.0 // indirect + golang.org/x/sys v0.45.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f9f9ed5d6..1a99dde11 100644 --- a/go.sum +++ b/go.sum @@ -23,7 +23,6 @@ github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500/go.mod h1:S/7n9cop github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -35,14 +34,16 @@ github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+Licev github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v82 v82.0.0 h1:OH09ESON2QwKCUVMYmMcVu1IFKFoaZHwqYaUtr/MVfk= -github.com/google/go-github/v82 v82.0.0/go.mod h1:hQ6Xo0VKfL8RZ7z1hSfB4fvISg0QqHOqe9BP0qo+WvM= github.com/google/go-github/v84 v84.0.0 h1:I/0Xn5IuChMe8TdmI2bbim5nyhaRFJ7DEdzmD2w+yVA= github.com/google/go-github/v84 v84.0.0/go.mod h1:WwYL1z1ajRdlaPszjVu/47x1L0PXukJBn73xsiYrRRQ= +github.com/google/go-github/v85 v85.0.0 h1:1+TLFX/akTFXK7o9Z9uAloQGufOn4ySa5DItUM1VWT4= +github.com/google/go-github/v85 v85.0.0/go.mod h1:jYkBnqN+SzR2A2fGKYfbt6DEEQAyxeK0Q2XpPV9ZFsU= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/hairyhenderson/go-codeowners v0.7.0 h1:s0W4wF8bdsBEjTWzwzSlsatSthWtTAF2xLgo4a4RwAo= +github.com/hairyhenderson/go-codeowners v0.7.0/go.mod h1:wUlNgQ3QjqC4z8DnM5nnCYVq/icpqXJyJOukKx5U8/Q= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -60,14 +61,14 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/palantir/go-baseapp v0.6.0 h1:59UU9rgrd4x2QP/Hb0XqZJ5ZCH6m7BaaPnA+VWKWaTI= -github.com/palantir/go-baseapp v0.6.0/go.mod h1:sa/waQhryV7OlPMykG0MUT+nsLtDxdHHPv5Q60hA/Ek= -github.com/palantir/go-githubapp v0.41.0 h1:BpFBhXVlYrpBTo/hMrtB0dKw9dm5QbjXwGRTOjW5iDc= -github.com/palantir/go-githubapp v0.41.0/go.mod h1:O4ZGCVoycs9T/xJyuHx2bjhi5UxYUqIGcS97y5ncfYo= +github.com/palantir/go-baseapp v0.7.0 h1:KsnCqz2T2j2m21JI149p8HUata9ubvVl2aKbw71u8qA= +github.com/palantir/go-baseapp v0.7.0/go.mod h1:EvMBTXraSU+5cRCZTNt4e+eNty7t2me565Gr/6wc4/I= +github.com/palantir/go-githubapp v0.44.0 h1:6QXYxgot6tHnObwJ09mrhzVg9K2DA0lQgQHj0q/BX4Y= +github.com/palantir/go-githubapp v0.44.0/go.mod h1:vFTHSErTFXirDg18QMtFPKDbQ/NB6n8JE8L1yG/3Ij0= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -88,8 +89,8 @@ github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0t github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= -github.com/rs/zerolog v1.35.0 h1:VD0ykx7HMiMJytqINBsKcbLS+BJ4WYjz+05us+LRTdI= -github.com/rs/zerolog v1.35.0/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw= +github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI= +github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= @@ -130,14 +131,14 @@ goji.io v2.0.2+incompatible h1:uIssv/elbKRLznFUy3Xj4+2Mz/qKhek/9aZQDUMae7c= goji.io v2.0.2+incompatible/go.mod h1:sbqFwrtqZACxLBTQcdgVjFh54yGVCvwq8+w49MVMMIk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= -golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= +golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo= -golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -149,9 +150,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/godel/config/dist-plugin.yml b/godel/config/dist-plugin.yml index c2282bb4f..fbefdeb53 100644 --- a/godel/config/dist-plugin.yml +++ b/godel/config/dist-plugin.yml @@ -7,7 +7,7 @@ products: build: output-dir: build main-pkg: . - version-var: github.com/palantir/policy-bot/version.version + version-var: develop.version environment: CGO_ENABLED: "0" os-archs: @@ -41,8 +41,6 @@ products: cp -R docker/* ${CONTEXT_DIR} cp -R config ${CONTEXT_DIR} tag-templates: - version: "{{Repository}}palantirtechnologies/policy-bot:{{Version}}" - latest: "{{Repository}}palantirtechnologies/policy-bot:latest" - snapshot: "{{Repository}}palantirtechnologies/policy-bot:snapshot" + version: "{{Repository}}us-central1-docker.pkg.dev/gcp-motion-mgmt/external/policy-bot:{{Version}}" publish: - group-id: com.palantir.policy-bot + group-id: com.palantir.policy-bo22838 diff --git a/godel/config/godel.properties b/godel/config/godel.properties index 7e3977976..07c986bc9 100644 --- a/godel/config/godel.properties +++ b/godel/config/godel.properties @@ -1,2 +1,2 @@ -distributionURL=https://github.com/palantir/godel/releases/download/v2.152.0/godel-2.152.0.tgz -distributionSHA256=22b00b61a2cea5dccb8734fabfedbddebd90276c585b3c9d74a4d02dbabe244a +distributionURL=https://github.com/palantir/godel/releases/download/v2.155.0/godel-2.155.0.tgz +distributionSHA256=dafe84757c27f26b5b474c289b4d2f24c332f4e938db0b186107ad00efb1348e diff --git a/godelw b/godelw index 1a15a649b..bdeed5020 100755 --- a/godelw +++ b/godelw @@ -3,11 +3,11 @@ set -euo pipefail # Version and checksums for godel. Values are populated by the godel "dist" task. -VERSION=2.152.0 -DARWIN_AMD64_CHECKSUM=3f2a859406e6a8ef244e1d9cb7e382758897d1be69691a3f3728f568b3dd871d -DARWIN_ARM64_CHECKSUM=9e05c7651ac85e5a57f11c474abd78da2d255ea70c3743f8d179a23a3c61dadd -LINUX_AMD64_CHECKSUM=65cadd08c7f3d8825a9761102852811f990e89d6c7022172704589d56ece4241 -LINUX_ARM64_CHECKSUM=a9daf24e64688ffd8317824f0292b55b4f3277270208366b861737fbd47a9b8f +VERSION=2.155.0 +DARWIN_AMD64_CHECKSUM=3ee0ca1b2a99db0f819253bab1f853356722a1066d1ea4c3872054c0e777b692 +DARWIN_ARM64_CHECKSUM=75cd24217a0df7097d78f71abb5946c7b9cbc2ec9b970e4e35a52ab3bfccb1ca +LINUX_AMD64_CHECKSUM=6e2febb2552f0f91c4c19a136e73eddab6b68ef44dbefd433e97f6efc2ae6e86 +LINUX_ARM64_CHECKSUM=ac86d09277edb0979dd9be0f3eb0e3d48b26da83ebed6f957f00dcc1f312cce9 # Downloads file at URL to destination path using wget or curl. Prints an error and exits if wget or curl is not present. function download { diff --git a/package.json b/package.json index d9afb941f..13bf33334 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,14 @@ "build:production": "NODE_ENV=production webpack build" }, "devDependencies": { - "autoprefixer": "^10.4.27", + "autoprefixer": "^10.5.0", "css-loader": "^7.1.4", "cssnano": "^7.1", "mini-css-extract-plugin": "^2.10.2", "postcss": "^8.5", "postcss-loader": "^8.2.1", "tailwindcss": "^3.0", - "webpack": "^5.105.4", + "webpack": "^5.106.2", "webpack-cli": "^7.0.2", "webpack-manifest-plugin": "^6.0.1" }, diff --git a/policy/approval/approve.go b/policy/approval/approve.go index 69e6212ad..9922b027c 100644 --- a/policy/approval/approve.go +++ b/policy/approval/approve.go @@ -19,6 +19,7 @@ import ( "fmt" "sort" "strings" + "sync" "time" "github.com/palantir/policy-bot/policy/common" @@ -151,6 +152,7 @@ func (r *Rule) getReviewRequestRule() *common.ReviewRequestRule { Teams: r.Requires.Actors.Teams, Organizations: r.Requires.Actors.Organizations, Permissions: r.Requires.Actors.GetPermissions(), + Codeowners: r.Requires.Actors.Codeowners, RequiredCount: r.Requires.Count, RequestedCount: requestedCount, Mode: mode, @@ -158,7 +160,7 @@ func (r *Rule) getReviewRequestRule() *common.ReviewRequestRule { } func (r *Rule) IsApproved(ctx context.Context, prctx pull.Context, candidates []*common.Candidate) (bool, common.RequiresResult, error) { - approvedByActors, approvers, err := r.isApprovedByActors(ctx, prctx, candidates) + approvedByActors, approvers, ownershipGroups, err := r.isApprovedByActors(ctx, prctx, candidates) if err != nil { return false, common.RequiresResult{}, err } @@ -169,20 +171,21 @@ func (r *Rule) IsApproved(ctx context.Context, prctx pull.Context, candidates [] } result := common.RequiresResult{ - Count: r.Requires.Count, - Actors: r.Requires.Actors, - Approvers: approvers, - Conditions: conditions, + Count: r.Requires.Count, + Actors: r.Requires.Actors, + Approvers: approvers, + Conditions: conditions, + OwnershipGroups: ownershipGroups, } return approvedByActors && approvedByConditions, result, nil } -func (r *Rule) isApprovedByActors(ctx context.Context, prctx pull.Context, candidates []*common.Candidate) (bool, []*common.Candidate, error) { +func (r *Rule) isApprovedByActors(ctx context.Context, prctx pull.Context, candidates []*common.Candidate) (bool, []*common.Candidate, []common.OwnershipGroupResult, error) { log := zerolog.Ctx(ctx) - if r.Requires.Count <= 0 { + if r.Requires.Count <= 0 && !r.Requires.Actors.Codeowners { log.Debug().Msg("rule requires no approvals") - return true, nil, nil + return true, nil, nil, nil } log.Debug().Msgf("found %d candidates for approval", len(candidates)) @@ -202,7 +205,7 @@ func (r *Rule) isApprovedByActors(ctx context.Context, prctx pull.Context, candi if !r.Options.IsAllowContributor() && !r.Options.IsAllowNonAuthorContributor() { commits, err := r.filteredCommits(ctx, prctx) if err != nil { - return false, nil, err + return false, nil, nil, err } for _, c := range commits { @@ -214,20 +217,25 @@ func (r *Rule) isApprovedByActors(ctx context.Context, prctx pull.Context, candi } } + // If codeowners is enabled, delegate to codeowner group logic + if r.Requires.Actors.Codeowners { + return r.isApprovedByCodeownerGroups(ctx, prctx, candidates, banned) + } + // filter real approvers using banned status and required membership var approvers []*common.Candidate for _, c := range candidates { - if banned[c.User] { - log.Debug().Str("user", c.User).Msg("rejecting approval by banned user") + if banned[c.User()] { + log.Debug().Str("user", c.User()).Msg("rejecting approval by banned user") continue } - isApprover, err := r.Requires.Actors.IsActor(ctx, prctx, c.User) + isApprover, err := r.Requires.Actors.IsActor(ctx, prctx, c.User()) if err != nil { - return false, nil, errors.Wrap(err, "failed to check candidate status") + return false, nil, nil, errors.Wrap(err, "failed to check candidate status") } if !isApprover { - log.Debug().Str("user", c.User).Msg("ignoring approval by non-required user") + log.Debug().Str("user", c.User()).Msg("ignoring approval by non-required user") continue } @@ -235,7 +243,7 @@ func (r *Rule) isApprovedByActors(ctx context.Context, prctx pull.Context, candi } log.Debug().Msgf("found %d/%d required approvers", len(approvers), r.Requires.Count) - return len(approvers) >= r.Requires.Count, approvers, nil + return len(approvers) >= r.Requires.Count, approvers, nil, nil } func (r *Rule) isApprovedByConditions(ctx context.Context, prctx pull.Context) (bool, []*common.PredicateResult, error) { @@ -268,7 +276,7 @@ func (r *Rule) isApprovedByConditions(ctx context.Context, prctx pull.Context) ( // FilteredCandidates returns the potential approval candidates and any // candidates that should be dimissed due to rule options. func (r *Rule) FilteredCandidates(ctx context.Context, prctx pull.Context) ([]*common.Candidate, []*common.Dismissal, error) { - if r.Requires.Count <= 0 { + if r.Requires.Count <= 0 && !r.Requires.Actors.Codeowners { return nil, nil, nil } @@ -302,7 +310,7 @@ func (r *Rule) FilteredCandidates(ctx context.Context, prctx pull.Context) ([]*c return candidates, dismissals, nil } -func (r *Rule) filterEditedCandidates(ctx context.Context, prctx pull.Context, candidates []*common.Candidate) ([]*common.Candidate, []*common.Dismissal, error) { +func (r *Rule) filterEditedCandidates(ctx context.Context, _ pull.Context, candidates []*common.Candidate) ([]*common.Candidate, []*common.Dismissal, error) { log := zerolog.Ctx(ctx) if !r.Options.IsIgnoreEditedComments() { @@ -408,23 +416,27 @@ func (r *Rule) filteredCommits(ctx context.Context, prctx pull.Context) ([]*pull func statusDescription(approved bool, result common.RequiresResult, candidates []*common.Candidate) string { hasActors := result.Count > 0 hasConditions := len(result.Conditions) > 0 + hasOwnershipGroups := len(result.OwnershipGroups) > 0 if approved { - if !hasActors && !hasConditions { + if !hasActors && !hasConditions && !hasOwnershipGroups { return "No approval required" } var desc strings.Builder - desc.WriteString("Approved by ") - - for i, c := range result.Approvers { - if i > 0 { - desc.WriteString(", ") + if hasOwnershipGroups { + desc.WriteString(ownershipGroupsStatusDescription(result.OwnershipGroups)) + } else { + desc.WriteString("Approved by ") + for i, c := range result.Approvers { + if i > 0 { + desc.WriteString(", ") + } + desc.WriteString(c.User()) } - desc.WriteString(c.User) } if hasConditions { - if hasActors { + if hasActors || hasOwnershipGroups { desc.WriteString(" and ") } desc.WriteString("required conditions") @@ -434,11 +446,13 @@ func statusDescription(approved bool, result common.RequiresResult, candidates [ } var desc strings.Builder - if hasActors { + if hasOwnershipGroups { + desc.WriteString(ownershipGroupsStatusDescription(result.OwnershipGroups)) + } else if hasActors { fmt.Fprintf(&desc, "%d/%d required approvals", len(result.Approvers), result.Count) } if hasConditions { - if hasActors { + if hasActors || hasOwnershipGroups { desc.WriteString(" and ") } @@ -450,12 +464,37 @@ func statusDescription(approved bool, result common.RequiresResult, candidates [ } fmt.Fprintf(&desc, "%d/%d required conditions", successful, len(result.Conditions)) } - if disqualified := len(candidates) - len(result.Approvers); hasActors && disqualified > 0 { + if disqualified := len(candidates) - len(result.Approvers); hasActors && !hasOwnershipGroups && disqualified > 0 { fmt.Fprintf(&desc, ". Ignored %s from disqualified users", numberOfApprovals(disqualified)) } return desc.String() } +func ownershipGroupsStatusDescription(groups []common.OwnershipGroupResult) string { + var satisfied int + approverSet := make(map[string]struct{}) + + for _, g := range groups { + if g.Satisfied { + satisfied++ + for _, a := range g.Approvers { + approverSet[a] = struct{}{} + } + } + } + + if satisfied < len(groups) { + return fmt.Sprintf("%d/%d ownership groups covered", satisfied, len(groups)) + } + + approvers := make([]string, 0, len(approverSet)) + for a := range approverSet { + approvers = append(approvers, a) + } + sort.Strings(approvers) + return fmt.Sprintf("Approved by %s covering %d ownership groups", strings.Join(approvers, ", "), len(groups)) +} + func isUpdateMerge(commits []*pull.Commit, c *pull.Commit) bool { // must be a simple merge commit (exactly 2 parents) if len(c.Parents) != 2 { @@ -520,3 +559,139 @@ func sortCommits(commits []*pull.Commit, head string) []*pull.Commit { } return ordered } + +// isApprovedByCodeownerGroups checks if all ownership groups have at least one +// approved candidate. Returns true if all groups are satisfied, the list of +// approvers, and the results for each ownership group. +func (r *Rule) isApprovedByCodeownerGroups( + ctx context.Context, + prctx pull.Context, + candidates []*common.Candidate, + banned map[string]bool, +) (bool, []*common.Candidate, []common.OwnershipGroupResult, error) { + log := zerolog.Ctx(ctx) + + co, err := prctx.Codeowners() + if err != nil { + return false, nil, nil, errors.Wrap(err, "failed to get codeowners") + } + if co == nil { + // No CODEOWNERS file - no codeowner requirements + log.Debug().Msg("no CODEOWNERS file found, skipping codeowner group check") + return true, nil, nil, nil + } + + groups := co.OwnershipGroups() + if len(groups) == 0 { + log.Debug().Msg("no ownership groups found, skipping codeowner group check") + return true, nil, nil, nil + } + + log.Debug().Msgf("found %d ownership groups to satisfy", len(groups)) + + // Pre-filter candidates to exclude banned users + validCandidates := make([]*common.Candidate, 0, len(candidates)) + for _, c := range candidates { + if !banned[c.User()] { + validCandidates = append(validCandidates, c) + } + } + + // Collect all unique (team, user) pairs that need membership checks + type memberCheck struct { + team string + user string + } + checksNeeded := make(map[memberCheck]struct{}) + for _, group := range groups { + for _, owner := range group.Owners { + ownerType, name := pull.ParseCodeowner(owner) + if ownerType == "team" { + for _, c := range validCandidates { + checksNeeded[memberCheck{team: name, user: c.User()}] = struct{}{} + } + } + } + } + + // Run all team membership checks in parallel + membershipResults := make(map[memberCheck]bool) + var mu sync.Mutex + var wg sync.WaitGroup + errChan := make(chan error, len(checksNeeded)) + + for check := range checksNeeded { + wg.Go(func() { + isMember, err := prctx.IsTeamMember(check.team, check.user) + if err != nil { + errChan <- errors.Wrapf(err, "failed to check team membership for %s in %s", check.user, check.team) + return + } + mu.Lock() + membershipResults[check] = isMember + mu.Unlock() + }) + } + + wg.Wait() + close(errChan) + + // Check for any errors + if err := <-errChan; err != nil { + return false, nil, nil, err + } + + // Process results using the cached membership data + results := make([]common.OwnershipGroupResult, len(groups)) + var approvers []*common.Candidate + approverSet := make(map[string]struct{}) + + for i, group := range groups { + results[i] = common.OwnershipGroupResult{ + Key: group.Key, + Owners: group.Owners, + Files: group.Files, + } + + for _, c := range validCandidates { + isMember := false + for _, owner := range group.Owners { + ownerType, name := pull.ParseCodeowner(owner) + switch ownerType { + case "user": + if strings.EqualFold(c.User(), name) { + isMember = true + } + case "team": + if membershipResults[memberCheck{team: name, user: c.User()}] { + isMember = true + } + } + if isMember { + break + } + } + + if isMember { + results[i].Satisfied = true + results[i].Approvers = append(results[i].Approvers, c.User()) + if _, exists := approverSet[c.User()]; !exists { + approvers = append(approvers, c) + approverSet[c.User()] = struct{}{} + } + } + } + } + + // Count satisfied groups + satisfiedCount := 0 + for _, result := range results { + if result.Satisfied { + satisfiedCount++ + } + } + + log.Debug().Msgf("%d/%d ownership groups satisfied", satisfiedCount, len(results)) + + return satisfiedCount == len(results), approvers, results, nil +} diff --git a/policy/approval/approve_test.go b/policy/approval/approve_test.go index e4b4fd250..2c9270212 100644 --- a/policy/approval/approve_test.go +++ b/policy/approval/approve_test.go @@ -31,6 +31,10 @@ import ( "github.com/stretchr/testify/require" ) +func ptr[T any](v T) *T { + return &v +} + var defaultOptions = Options{ Methods: DefaultMethods(), } @@ -47,49 +51,49 @@ func TestIsApproved(t *testing.T) { Body: "/no-platform", CreatedAt: now.Add(10 * time.Second), LastEditedAt: now.Add(20 * time.Second), - Author: "body-editor", + Author: pull.NewAuthor("body-editor"), }, CommentsValue: []*pull.Comment{ { CreatedAt: now.Add(10 * time.Second), LastEditedAt: time.Time{}, - Author: "other-user", + Author: pull.NewAuthor("other-user"), Body: "Why did you do this?", }, { CreatedAt: now.Add(20 * time.Second), LastEditedAt: time.Time{}, - Author: "comment-approver", + Author: pull.NewAuthor("comment-approver"), Body: "LGTM :+1: :shipit:", }, { CreatedAt: now.Add(30 * time.Second), LastEditedAt: time.Time{}, - Author: "disapprover", + Author: pull.NewAuthor("disapprover"), Body: "I don't like things! :-1:", }, { CreatedAt: now.Add(40 * time.Second), LastEditedAt: time.Time{}, - Author: "mhaypenny", + Author: pull.NewAuthor("mhaypenny"), Body: ":+1: my stuff is cool", }, { CreatedAt: now.Add(50 * time.Second), LastEditedAt: time.Time{}, - Author: "contributor-author", + Author: pull.NewAuthor("contributor-author"), Body: ":+1: I added to this PR", }, { CreatedAt: now.Add(60 * time.Second), LastEditedAt: time.Time{}, - Author: "contributor-committer", + Author: pull.NewAuthor("contributor-committer"), Body: ":+1: I also added to this PR", }, { CreatedAt: now.Add(70 * time.Second), LastEditedAt: now.Add(71 * time.Second), - Author: "comment-editor", + Author: pull.NewAuthor("comment-editor"), Body: "LGTM :+1: :shipit:", }, }, @@ -97,21 +101,21 @@ func TestIsApproved(t *testing.T) { { CreatedAt: now.Add(70 * time.Second), LastEditedAt: time.Time{}, - Author: "disapprover", + Author: pull.NewAuthor("disapprover"), State: pull.ReviewChangesRequested, Body: "I _really_ don't like things!", }, { CreatedAt: now.Add(80 * time.Second), LastEditedAt: time.Time{}, - Author: "review-approver", + Author: pull.NewAuthor("review-approver"), State: pull.ReviewApproved, Body: "I LIKE THIS", }, { CreatedAt: now.Add(90 * time.Second), LastEditedAt: now.Add(91 * time.Second), - Author: "review-comment-editor", + Author: pull.NewAuthor("review-comment-editor"), State: pull.ReviewApproved, Body: "I LIKE THIS", }, @@ -513,7 +517,7 @@ func TestIsApproved(t *testing.T) { }) prctx.CommentsValue = append(prctx.CommentsValue, &pull.Comment{ CreatedAt: now.Add(100 * time.Second), - Author: "merge-committer", + Author: pull.NewAuthor("merge-committer"), Body: ":+1:", }) @@ -1008,3 +1012,371 @@ func TestSortCommits(t *testing.T) { }) } } + +func TestCodeownerGroupApproval(t *testing.T) { + logger := zerolog.New(os.Stdout) + ctx := logger.WithContext(context.Background()) + + now := time.Now() + + t.Run("allGroupsApprovedBySingleReviewer", func(t *testing.T) { + // Single reviewer is member of both team-a and team-c, satisfying both groups + prctx := &pulltest.Context{ + AuthorValue: "author", + TeamMemberships: map[string][]string{ + "reviewer1": {"org/team-a", "org/team-c"}, + }, + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("reviewer1"), State: pull.ReviewApproved, CreatedAt: now}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@org/team-a"}, + "c/file.go": {"@org/team-c"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + candidates, _, err := r.FilteredCandidates(ctx, prctx) + require.NoError(t, err) + + approved, result, err := r.IsApproved(ctx, prctx, candidates) + require.NoError(t, err) + assert.True(t, approved) + assert.Len(t, result.OwnershipGroups, 2) + for _, g := range result.OwnershipGroups { + assert.True(t, g.Satisfied, "group %s should be satisfied", g.Key) + } + }) + + t.Run("partialGroupApproval", func(t *testing.T) { + // reviewer1 is only in team-a, so team-b group is not satisfied + prctx := &pulltest.Context{ + AuthorValue: "author", + TeamMemberships: map[string][]string{ + "reviewer1": {"org/team-a"}, + }, + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("reviewer1"), State: pull.ReviewApproved, CreatedAt: now}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@org/team-a"}, + "b/file.go": {"@org/team-b"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + candidates, _, err := r.FilteredCandidates(ctx, prctx) + require.NoError(t, err) + + approved, result, err := r.IsApproved(ctx, prctx, candidates) + require.NoError(t, err) + assert.False(t, approved) + assert.Len(t, result.OwnershipGroups, 2) + + // Check which group is satisfied + groupByKey := make(map[string]common.OwnershipGroupResult) + for _, g := range result.OwnershipGroups { + groupByKey[g.Key] = g + } + assert.True(t, groupByKey["@org/team-a"].Satisfied) + assert.False(t, groupByKey["@org/team-b"].Satisfied) + }) + + t.Run("multipleReviewersSatisfyAllGroups", func(t *testing.T) { + // Two reviewers, each covering different groups + prctx := &pulltest.Context{ + AuthorValue: "author", + TeamMemberships: map[string][]string{ + "reviewer1": {"org/team-a"}, + "reviewer2": {"org/team-b", "org/team-c"}, + }, + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("reviewer1"), State: pull.ReviewApproved, CreatedAt: now}, + {Author: pull.NewAuthor("reviewer2"), State: pull.ReviewApproved, CreatedAt: now.Add(time.Second)}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@org/team-a"}, + "b/file.go": {"@org/team-b"}, + "c/file.go": {"@org/team-c"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + candidates, _, err := r.FilteredCandidates(ctx, prctx) + require.NoError(t, err) + + approved, result, err := r.IsApproved(ctx, prctx, candidates) + require.NoError(t, err) + assert.True(t, approved) + assert.Len(t, result.OwnershipGroups, 3) + for _, g := range result.OwnershipGroups { + assert.True(t, g.Satisfied, "group %s should be satisfied", g.Key) + } + }) + + t.Run("userCodeownerApproval", func(t *testing.T) { + // Direct user codeowner (not team) + prctx := &pulltest.Context{ + AuthorValue: "author", + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("johndoe"), State: pull.ReviewApproved, CreatedAt: now}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "file.go": {"@johndoe"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + candidates, _, err := r.FilteredCandidates(ctx, prctx) + require.NoError(t, err) + + approved, result, err := r.IsApproved(ctx, prctx, candidates) + require.NoError(t, err) + assert.True(t, approved) + assert.Len(t, result.OwnershipGroups, 1) + assert.True(t, result.OwnershipGroups[0].Satisfied) + assert.Contains(t, result.OwnershipGroups[0].Approvers, "johndoe") + }) + + t.Run("noCodeownersFile", func(t *testing.T) { + // No CODEOWNERS file - should pass (no codeowner requirements) + prctx := &pulltest.Context{ + AuthorValue: "author", + CodeownersValue: nil, // No CODEOWNERS file + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + candidates, _, err := r.FilteredCandidates(ctx, prctx) + require.NoError(t, err) + + approved, result, err := r.IsApproved(ctx, prctx, candidates) + require.NoError(t, err) + assert.True(t, approved) + assert.Empty(t, result.OwnershipGroups) + }) + + t.Run("authorCannotApproveOwnGroup", func(t *testing.T) { + // Author is a codeowner but shouldn't be able to approve (default behavior) + prctx := &pulltest.Context{ + AuthorValue: "johndoe", + TeamMemberships: map[string][]string{ + "johndoe": {"org/team-a"}, + }, + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("johndoe"), State: pull.ReviewApproved, CreatedAt: now}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "johndoe"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@org/team-a"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + AllowAuthor: new(false), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + candidates, _, err := r.FilteredCandidates(ctx, prctx) + require.NoError(t, err) + + approved, result, err := r.IsApproved(ctx, prctx, candidates) + require.NoError(t, err) + assert.False(t, approved) + assert.Len(t, result.OwnershipGroups, 1) + assert.False(t, result.OwnershipGroups[0].Satisfied) + }) + + t.Run("filesWithSameOwnersGroupedTogether", func(t *testing.T) { + // Multiple files with the same owner should be in one group + prctx := &pulltest.Context{ + AuthorValue: "author", + TeamMemberships: map[string][]string{ + "reviewer1": {"org/team-a"}, + }, + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("reviewer1"), State: pull.ReviewApproved, CreatedAt: now}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "a/file1.go": {"@org/team-a"}, + "a/file2.go": {"@org/team-a"}, + "a/file3.go": {"@org/team-a"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + candidates, _, err := r.FilteredCandidates(ctx, prctx) + require.NoError(t, err) + + approved, result, err := r.IsApproved(ctx, prctx, candidates) + require.NoError(t, err) + assert.True(t, approved) + assert.Len(t, result.OwnershipGroups, 1) // All files in one group + assert.Len(t, result.OwnershipGroups[0].Files, 3) + }) + + t.Run("statusDescriptionShowsOwnershipGroups", func(t *testing.T) { + // Test status description for pending with ownership groups + prctx := &pulltest.Context{ + AuthorValue: "author", + TeamMemberships: map[string][]string{ + "reviewer1": {"org/team-a"}, + }, + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("reviewer1"), State: pull.ReviewApproved, CreatedAt: now}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@org/team-a"}, + "b/file.go": {"@org/team-b"}, + "c/file.go": {"@org/team-c"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + result := r.Evaluate(ctx, prctx) + assert.Equal(t, common.StatusPending, result.Status) + assert.Contains(t, result.StatusDescription, "1/3 ownership groups covered") + }) + + t.Run("statusDescriptionShowsApprovedWithGroups", func(t *testing.T) { + // Test status description for approved with ownership groups + prctx := &pulltest.Context{ + AuthorValue: "author", + TeamMemberships: map[string][]string{ + "reviewer1": {"org/team-a", "org/team-b"}, + }, + ReviewsValue: []*pull.Review{ + {Author: pull.NewAuthor("reviewer1"), State: pull.ReviewApproved, CreatedAt: now}, + }, + CommitsValue: []*pull.Commit{ + {SHA: "abc123", Author: "author"}, + }, + HeadSHAValue: "abc123", + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@org/team-a"}, + "b/file.go": {"@org/team-b"}, + }, + }, + } + + r := &Rule{ + Options: Options{ + Methods: DefaultMethods(), + }, + Requires: Requires{ + Actors: common.Actors{Codeowners: true}, + }, + } + + result := r.Evaluate(ctx, prctx) + assert.Equal(t, common.StatusApproved, result.Status) + assert.Contains(t, result.StatusDescription, "Approved by reviewer1") + assert.Contains(t, result.StatusDescription, "2 ownership groups") + }) +} diff --git a/policy/common/actor.go b/policy/common/actor.go index 2bdc54040..ad327d6e8 100644 --- a/policy/common/actor.go +++ b/policy/common/actor.go @@ -38,12 +38,17 @@ type Actors struct { // A list of GitHub collaborator permissions that are allowed. Values may // be any of "admin", "maintain", "write", "triage", and "read". Permissions []pull.Permission `yaml:"permissions,omitempty" json:"permissions"` + + // Codeowners specifies that codeowners of changed files are allowed actors. + // If true, users who are listed as codeowners of any changed file in the + // CODEOWNERS file can satisfy this actor requirement. + Codeowners bool `yaml:"codeowners,omitempty" json:"codeowners"` } // IsZero returns true if no conditions for actors are defined. func (a *Actors) IsZero() bool { return a == nil || (len(a.Users) == 0 && len(a.Teams) == 0 && len(a.Organizations) == 0 && - len(a.Permissions) == 0 && !a.Admins && !a.WriteCollaborators) + len(a.Permissions) == 0 && !a.Admins && !a.WriteCollaborators && !a.Codeowners) } // GetPermissions returns unique permissions ordered from most to least @@ -115,5 +120,45 @@ func (a *Actors) IsActor(ctx context.Context, prctx pull.Context, user string) ( } } + if a.Codeowners { + isOwner, err := a.isCodeowner(prctx, user) + if err != nil { + return false, errors.Wrap(err, "failed to check codeowner status") + } + if isOwner { + return true, nil + } + } + + return false, nil +} + +// isCodeowner checks if the user is a codeowner of any changed file. +func (a *Actors) isCodeowner(prctx pull.Context, user string) (bool, error) { + co, err := prctx.Codeowners() + if err != nil { + return false, err + } + if co == nil { + return false, nil + } + + for _, owner := range co.AllOwners() { + ownerType, name := pull.ParseCodeowner(owner) + switch ownerType { + case "user": + if user == name { + return true, nil + } + case "team": + isMember, err := prctx.IsTeamMember(name, user) + if err != nil { + return false, errors.Wrapf(err, "failed to check team membership for %s", name) + } + if isMember { + return true, nil + } + } + } return false, nil } diff --git a/policy/common/actor_test.go b/policy/common/actor_test.go index 82ccfff19..f6a61da2d 100644 --- a/policy/common/actor_test.go +++ b/policy/common/actor_test.go @@ -115,6 +115,99 @@ func TestIsActor(t *testing.T) { }) } +func TestIsActorCodeowners(t *testing.T) { + ctx := context.Background() + + t.Run("user codeowner", func(t *testing.T) { + prctx := &pulltest.Context{ + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "src/main.go": {"@mhaypenny", "@other-user"}, + }, + }, + } + + a := &Actors{Codeowners: true} + + isActor, err := a.IsActor(ctx, prctx, "mhaypenny") + require.NoError(t, err) + assert.True(t, isActor, "codeowner should be an actor") + + isActor, err = a.IsActor(ctx, prctx, "other-user") + require.NoError(t, err) + assert.True(t, isActor, "codeowner should be an actor") + + isActor, err = a.IsActor(ctx, prctx, "random-user") + require.NoError(t, err) + assert.False(t, isActor, "non-codeowner should not be an actor") + }) + + t.Run("team codeowner", func(t *testing.T) { + prctx := &pulltest.Context{ + TeamMemberships: map[string][]string{ + "team-member": {"myorg/my-team"}, + }, + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "src/main.go": {"@myorg/my-team"}, + }, + }, + } + + a := &Actors{Codeowners: true} + + isActor, err := a.IsActor(ctx, prctx, "team-member") + require.NoError(t, err) + assert.True(t, isActor, "team member should be an actor") + + isActor, err = a.IsActor(ctx, prctx, "non-member") + require.NoError(t, err) + assert.False(t, isActor, "non-team-member should not be an actor") + }) + + t.Run("no codeowners file", func(t *testing.T) { + prctx := &pulltest.Context{ + CodeownersValue: nil, + } + + a := &Actors{Codeowners: true} + + isActor, err := a.IsActor(ctx, prctx, "anyone") + require.NoError(t, err) + assert.False(t, isActor, "should not be an actor when no CODEOWNERS file") + }) + + t.Run("empty owners for file", func(t *testing.T) { + prctx := &pulltest.Context{ + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{}, + }, + } + + a := &Actors{Codeowners: true} + + isActor, err := a.IsActor(ctx, prctx, "anyone") + require.NoError(t, err) + assert.False(t, isActor, "should not be an actor when no owners defined") + }) + + t.Run("codeowners disabled", func(t *testing.T) { + prctx := &pulltest.Context{ + CodeownersValue: &pull.CodeownersResult{ + Owners: map[string][]string{ + "src/main.go": {"@mhaypenny"}, + }, + }, + } + + a := &Actors{Codeowners: false} + + isActor, err := a.IsActor(ctx, prctx, "mhaypenny") + require.NoError(t, err) + assert.False(t, isActor, "should not be an actor when codeowners is disabled") + }) +} + func TestIsEmpty(t *testing.T) { a := &Actors{} assert.True(t, a.IsZero(), "Actors struct was not empty") @@ -128,6 +221,9 @@ func TestIsEmpty(t *testing.T) { a = &Actors{Organizations: []string{"org"}} assert.False(t, a.IsZero(), "Actors struct was empty") + a = &Actors{Codeowners: true} + assert.False(t, a.IsZero(), "Actors struct was empty") + a = nil assert.True(t, a.IsZero(), "nil struct was not empty") } diff --git a/policy/common/methods.go b/policy/common/methods.go index 59ea42948..1643aa5eb 100644 --- a/policy/common/methods.go +++ b/policy/common/methods.go @@ -101,11 +101,19 @@ const ( type Candidate struct { Type CandidateType ReviewID string - User string + Author *pull.Author CreatedAt time.Time LastEditedAt time.Time } +// User returns the author's login for backward compatibility. +func (c *Candidate) User() string { + if c.Author == nil { + return "" + } + return c.Author.Login +} + type CandidatesByCreationTime []*Candidate func (cs CandidatesByCreationTime) Len() int { return len(cs) } @@ -131,7 +139,7 @@ func (m *Methods) Candidates(ctx context.Context, prctx pull.Context) ([]*Candid if m.CommentMatches(c.Body) { candidates = append(candidates, &Candidate{ Type: CommentCandidate, - User: c.Author, + Author: c.Author, CreatedAt: c.CreatedAt, LastEditedAt: c.LastEditedAt, }) @@ -146,7 +154,7 @@ func (m *Methods) Candidates(ctx context.Context, prctx pull.Context) ([]*Candid } if m.BodyMatches(prBody.Body) { candidates = append(candidates, &Candidate{ - User: prBody.Author, + Author: prBody.Author, CreatedAt: prBody.CreatedAt, LastEditedAt: prBody.LastEditedAt, }) @@ -166,7 +174,7 @@ func (m *Methods) Candidates(ctx context.Context, prctx pull.Context) ([]*Candid candidates = append(candidates, &Candidate{ Type: ReviewCandidate, ReviewID: r.ID, - User: r.Author, + Author: r.Author, CreatedAt: r.CreatedAt, LastEditedAt: r.LastEditedAt, }) @@ -175,7 +183,7 @@ func (m *Methods) Candidates(ctx context.Context, prctx pull.Context) ([]*Candid candidates = append(candidates, &Candidate{ Type: ReviewCandidate, ReviewID: r.ID, - User: r.Author, + Author: r.Author, CreatedAt: r.CreatedAt, LastEditedAt: r.LastEditedAt, }) @@ -190,9 +198,9 @@ func (m *Methods) Candidates(ctx context.Context, prctx pull.Context) ([]*Candid func deduplicateCandidates(all []*Candidate) []*Candidate { users := make(map[string]*Candidate) for _, c := range all { - last, ok := users[c.User] + last, ok := users[c.User()] if !ok || last.CreatedAt.Before(c.CreatedAt) { - users[c.User] = c + users[c.User()] = c } } diff --git a/policy/common/methods_test.go b/policy/common/methods_test.go index bcf177f96..3f0e3f1fc 100644 --- a/policy/common/methods_test.go +++ b/policy/common/methods_test.go @@ -36,50 +36,50 @@ func TestCandidates(t *testing.T) { { CreatedAt: now.Add(0 * time.Minute), Body: "I like to comment!", - Author: "rrandom", + Author: pull.NewAuthor("rrandom"), }, { CreatedAt: now.Add(2 * time.Minute), Body: "Looks good to me :+1:", - Author: "mhaypenny", + Author: pull.NewAuthor("mhaypenny"), }, { CreatedAt: now.Add(4 * time.Minute), Body: ":lgtm:", - Author: "ttest", + Author: pull.NewAuthor("ttest"), }, { CreatedAt: now.Add(8 * time.Minute), Body: "I approve this, because it looks good to me.", - Author: "wstrawmoney", + Author: pull.NewAuthor("wstrawmoney"), }, }, ReviewsValue: []*pull.Review{ { CreatedAt: now.Add(1 * time.Minute), - Author: "rrandom", + Author: pull.NewAuthor("rrandom"), State: pull.ReviewCommented, }, { CreatedAt: now.Add(3 * time.Minute), - Author: "mhaypenny", + Author: pull.NewAuthor("mhaypenny"), State: pull.ReviewChangesRequested, Body: "pr needs work", }, { CreatedAt: now.Add(5 * time.Minute), - Author: "ttest", + Author: pull.NewAuthor("ttest"), State: pull.ReviewApproved, }, { CreatedAt: now.Add(7 * time.Minute), - Author: "santaclaus", + Author: pull.NewAuthor("santaclaus"), Body: "nice", State: pull.ReviewApproved, }, { CreatedAt: now.Add(9 * time.Minute), - Author: "dasherdancer", + Author: pull.NewAuthor("dasherdancer"), Body: "nIcE", State: pull.ReviewApproved, }, @@ -97,8 +97,8 @@ func TestCandidates(t *testing.T) { sort.Sort(CandidatesByCreationTime(cs)) require.Len(t, cs, 2, "incorrect number of candidates found") - assert.Equal(t, "mhaypenny", cs[0].User) - assert.Equal(t, "ttest", cs[1].User) + assert.Equal(t, "mhaypenny", cs[0].User()) + assert.Equal(t, "ttest", cs[1].User()) }) t.Run("commentPatterns", func(t *testing.T) { @@ -114,7 +114,7 @@ func TestCandidates(t *testing.T) { sort.Sort(CandidatesByCreationTime(cs)) require.Len(t, cs, 1, "incorrect number of candidates found") - assert.Equal(t, "mhaypenny", cs[0].User) + assert.Equal(t, "mhaypenny", cs[0].User()) }) t.Run("githubReviewCommentPatterns", func(t *testing.T) { @@ -133,8 +133,8 @@ func TestCandidates(t *testing.T) { sort.Sort(CandidatesByCreationTime(cs)) require.Len(t, cs, 2, "incorrect number of candidates found") - assert.Equal(t, "santaclaus", cs[0].User) - assert.Equal(t, "dasherdancer", cs[1].User) + assert.Equal(t, "santaclaus", cs[0].User()) + assert.Equal(t, "dasherdancer", cs[1].User()) }) t.Run("reviews", func(t *testing.T) { @@ -150,7 +150,7 @@ func TestCandidates(t *testing.T) { sort.Sort(CandidatesByCreationTime(cs)) require.Len(t, cs, 1, "incorrect number of candidates found") - assert.Equal(t, "mhaypenny", cs[0].User) + assert.Equal(t, "mhaypenny", cs[0].User()) }) t.Run("deduplicate", func(t *testing.T) { @@ -167,29 +167,29 @@ func TestCandidates(t *testing.T) { sort.Sort(CandidatesByCreationTime(cs)) require.Len(t, cs, 4, "incorrect number of candidates found") - assert.Equal(t, "mhaypenny", cs[0].User) - assert.Equal(t, "ttest", cs[1].User) - assert.Equal(t, "santaclaus", cs[2].User) - assert.Equal(t, "dasherdancer", cs[3].User) + assert.Equal(t, "mhaypenny", cs[0].User()) + assert.Equal(t, "ttest", cs[1].User()) + assert.Equal(t, "santaclaus", cs[2].User()) + assert.Equal(t, "dasherdancer", cs[3].User()) }) } func TestCandidatesByCreationTime(t *testing.T) { cs := []*Candidate{ { - User: "c", + Author: pull.NewAuthor("c"), CreatedAt: time.Date(2018, 6, 29, 12, 0, 0, 0, time.UTC), }, { - User: "a", + Author: pull.NewAuthor("a"), CreatedAt: time.Date(2018, 6, 28, 0, 0, 0, 0, time.UTC), }, { - User: "d", + Author: pull.NewAuthor("d"), CreatedAt: time.Date(2018, 6, 29, 14, 0, 0, 0, time.UTC), }, { - User: "b", + Author: pull.NewAuthor("b"), CreatedAt: time.Date(2018, 6, 29, 10, 0, 0, 0, time.UTC), }, } @@ -197,7 +197,7 @@ func TestCandidatesByCreationTime(t *testing.T) { sort.Sort(CandidatesByCreationTime(cs)) for i, u := range []string{"a", "b", "c", "d"} { - assert.Equalf(t, u, cs[i].User, "candidate at position %d is incorrect", i) + assert.Equalf(t, u, cs[i].User(), "candidate at position %d is incorrect", i) } } diff --git a/policy/common/result.go b/policy/common/result.go index ce0ca64b6..2cf3540c1 100644 --- a/policy/common/result.go +++ b/policy/common/result.go @@ -54,6 +54,7 @@ type ReviewRequestRule struct { Users []string Organizations []string Permissions []pull.Permission + Codeowners bool RequiredCount int RequestedCount int @@ -92,6 +93,29 @@ type RequiresResult struct { // Conditions contains the results of all required conditions Conditions []*PredicateResult + + // OwnershipGroups contains the results for each codeowner group when + // codeowners approval is required. Each group must have at least one + // approver for the rule to pass. + OwnershipGroups []OwnershipGroupResult +} + +// OwnershipGroupResult contains the approval status for a codeowner group. +type OwnershipGroupResult struct { + // Key is a deterministic identifier for this ownership group. + Key string + + // Owners contains the codeowners for this group (e.g., "@team-a", "@user1"). + Owners []string + + // Files contains the file paths that belong to this ownership group. + Files []string + + // Satisfied is true if at least one approver is a member of this group. + Satisfied bool + + // Approvers contains the usernames of approvers who are members of this group. + Approvers []string } type Dismissal struct { diff --git a/policy/disapproval/disapprove.go b/policy/disapproval/disapprove.go index d8b2a16f8..65903fde3 100644 --- a/policy/disapproval/disapprove.go +++ b/policy/disapproval/disapprove.go @@ -196,16 +196,16 @@ func (p *Policy) IsDisapproved(ctx context.Context, prctx pull.Context) (disappr // someone disapproved, but nobody has revoked case revoker == nil: disapproved = true - msg = fmt.Sprintf("Disapproved by %s", disapprover.User) + msg = fmt.Sprintf("Disapproved by %s", disapprover.User()) // the new disapproval appears after a revocation case disapprover.CreatedAt.After(revoker.CreatedAt): disapproved = true - msg = fmt.Sprintf("Disapproved by %s", disapprover.User) + msg = fmt.Sprintf("Disapproved by %s", disapprover.User()) // a disapproval has been revoked default: - msg = fmt.Sprintf("Disapproval revoked by %s", revoker.User) + msg = fmt.Sprintf("Disapproval revoked by %s", revoker.User()) } return } @@ -235,13 +235,13 @@ func (p *Policy) filter(ctx context.Context, prctx pull.Context, candidates []*c var filtered []*common.Candidate for _, c := range candidates { - ok, err := p.Requires.IsActor(ctx, prctx, c.User) + ok, err := p.Requires.IsActor(ctx, prctx, c.User()) if err != nil { return nil, errors.WithMessage(err, "failed to check candidate status") } if !ok { - log.Debug().Str("user", c.User).Msg("ignoring disapproval/revocation by non-whitelisted user") + log.Debug().Str("user", c.User()).Msg("ignoring disapproval/revocation by non-whitelisted user") continue } diff --git a/policy/disapproval/disapprove_test.go b/policy/disapproval/disapprove_test.go index 929d87629..08af49274 100644 --- a/policy/disapproval/disapprove_test.go +++ b/policy/disapproval/disapprove_test.go @@ -38,39 +38,39 @@ func TestIsDisapproved(t *testing.T) { TitleValue: "test: add disapproval predicate test", CommentsValue: []*pull.Comment{ { - Author: "disapprover-1", + Author: pull.NewAuthor("disapprover-1"), Body: "me no like :-1:", CreatedAt: date(0), }, { - Author: "disapprover-1", + Author: pull.NewAuthor("disapprover-1"), Body: "nah, is fine :+1:", CreatedAt: date(1), }, { - Author: "disapprover-2", + Author: pull.NewAuthor("disapprover-2"), Body: "me also no like :-1:", CreatedAt: date(2), }, { - Author: "disapprover-3", + Author: pull.NewAuthor("disapprover-3"), Body: "and me :-1:", CreatedAt: date(3), }, { - Author: "revoker-1", + Author: pull.NewAuthor("revoker-1"), Body: "you all wrong :+1:", CreatedAt: date(4), }, }, ReviewsValue: []*pull.Review{ { - Author: "disapprover-4", + Author: pull.NewAuthor("disapprover-4"), State: pull.ReviewChangesRequested, CreatedAt: date(5), }, { - Author: "revoker-2", + Author: pull.NewAuthor("revoker-2"), State: pull.ReviewApproved, CreatedAt: date(6), }, diff --git a/policy/reviewer/reviewer.go b/policy/reviewer/reviewer.go index b449271b2..f38a81bfd 100644 --- a/policy/reviewer/reviewer.go +++ b/policy/reviewer/reviewer.go @@ -17,6 +17,7 @@ package reviewer import ( "context" "fmt" + "maps" "math/rand" "slices" "sort" @@ -123,17 +124,25 @@ func selectRandomUsers(n int, users []string, r *rand.Rand) []string { return selections } -func selectTeamMembers(prctx pull.Context, allTeams []string) (map[string][]string, error) { - allTeamsMembers := make(map[string][]string) - for _, team := range allTeams { - teamMembers, err := prctx.TeamMembers(team) +func selectTeamMembers(prctx pull.Context, teams []string) (map[string][]string, error) { + teamMembers := make(map[string][]string) + for _, team := range teams { + members, err := prctx.TeamMembers(team) if err != nil { return nil, errors.Wrapf(err, "failed to get member listing for team %s", team) } - allTeamsMembers[team] = teamMembers + teamMembers[team] = members } + return teamMembers, nil +} - return allTeamsMembers, nil +// addTeamMembersToSet adds all members from the given teams to the user set. +func addTeamMembersToSet(teamMembers map[string][]string, userSet map[string]struct{}) { + for _, members := range teamMembers { + for _, user := range members { + userSet[user] = struct{}{} + } + } } func selectOrgMembers(prctx pull.Context, allOrgs []string) ([]string, error) { @@ -220,14 +229,11 @@ func selectUserReviewers(ctx context.Context, prctx pull.Context, selection *Sel if len(result.ReviewRequestRule.Teams) > 0 { logger.Debug().Msg("Selecting from teams for review") - teamsToUsers, err := selectTeamMembers(prctx, result.ReviewRequestRule.Teams) + teamMembers, err := selectTeamMembers(prctx, result.ReviewRequestRule.Teams) if err != nil { logger.Warn().Err(err).Msgf("failed to get member listing for teams, skipping team member selection") - } - for _, users := range teamsToUsers { - for _, user := range users { - allUsers[user] = struct{}{} - } + } else { + addTeamMembersToSet(teamMembers, allUsers) } } @@ -242,6 +248,26 @@ func selectUserReviewers(ctx context.Context, prctx pull.Context, selection *Sel } } + if result.ReviewRequestRule.Codeowners { + logger.Debug().Msg("Selecting from codeowners for review") + codeownerUsers, codeownerTeams, err := selectCodeowners(prctx) + if err != nil { + logger.Warn().Err(err).Msg("failed to get codeowners, skipping codeowner selection") + } else { + for _, user := range codeownerUsers { + allUsers[user] = struct{}{} + } + if len(codeownerTeams) > 0 { + teamMembers, err := selectTeamMembers(prctx, codeownerTeams) + if err != nil { + logger.Warn().Err(err).Msg("failed to get codeowner team members, skipping team member selection") + } else { + addTeamMembersToSet(teamMembers, allUsers) + } + } + } + } + minPerm := pull.PermissionNone if len(result.ReviewRequestRule.Permissions) > 0 { minPerm = slices.Min(result.ReviewRequestRule.Permissions) @@ -290,3 +316,33 @@ func requestsTeam(r *common.Result, team string) bool { func requestsPermission(r *common.Result, perm pull.Permission) bool { return slices.Contains(r.ReviewRequestRule.Permissions, perm) } + +// selectCodeowners returns the users and teams that are codeowners of the +// changed files in the pull request. +func selectCodeowners(prctx pull.Context) ([]string, []string, error) { + co, err := prctx.Codeowners() + if err != nil { + return nil, nil, err + } + if co == nil { + return nil, nil, nil + } + + userSet := make(map[string]struct{}) + teamSet := make(map[string]struct{}) + + for _, owner := range co.AllOwners() { + ownerType, name := pull.ParseCodeowner(owner) + switch ownerType { + case "user": + userSet[name] = struct{}{} + case "team": + teamSet[name] = struct{}{} + } + } + + users := slices.Sorted(maps.Keys(userSet)) + teams := slices.Sorted(maps.Keys(teamSet)) + + return users, teams, nil +} diff --git a/policy/simulated/context.go b/policy/simulated/context.go index 54e642c89..1ca69727b 100644 --- a/policy/simulated/context.go +++ b/policy/simulated/context.go @@ -50,21 +50,23 @@ func (c *Context) filterIgnoredComments(prCtx pull.Context, comments []*pull.Com return comments, nil } - var filteredComments []*pull.Comment + var filtered []*pull.Comment for _, comment := range comments { - isActor, err := c.options.IgnoreComments.IsActor(c.ctx, prCtx, comment.Author) + if comment.Author == nil { + filtered = append(filtered, comment) + continue + } + + isIgnored, err := c.options.IgnoreComments.IsActor(c.ctx, prCtx, comment.Author.Login) if err != nil { return nil, err } - - if isActor { - continue + if !isIgnored { + filtered = append(filtered, comment) } - - filteredComments = append(filteredComments, comment) } - return filteredComments, nil + return filtered, nil } func (c *Context) addApprovalComment(comments []*pull.Comment) []*pull.Comment { @@ -96,21 +98,23 @@ func (c *Context) filterIgnoredReviews(prCtx pull.Context, reviews []*pull.Revie return reviews, nil } - var filteredReviews []*pull.Review + var filtered []*pull.Review for _, review := range reviews { - isActor, err := c.options.IgnoreReviews.IsActor(c.ctx, prCtx, review.Author) + if review.Author == nil { + filtered = append(filtered, review) + continue + } + + isIgnored, err := c.options.IgnoreReviews.IsActor(c.ctx, prCtx, review.Author.Login) if err != nil { return nil, err } - - if isActor { - continue + if !isIgnored { + filtered = append(filtered, review) } - - filteredReviews = append(filteredReviews, review) } - return filteredReviews, nil + return filtered, nil } func (c *Context) addApprovalReview(reviews []*pull.Review) []*pull.Review { diff --git a/policy/simulated/context_test.go b/policy/simulated/context_test.go index e97fe5eca..8bf5f8ac5 100644 --- a/policy/simulated/context_test.go +++ b/policy/simulated/context_test.go @@ -37,8 +37,8 @@ func TestComments(t *testing.T) { }{ "ignore comments by user": { Comments: []*pull.Comment{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, ExpectedCommentAuthors: []string{"rrandom"}, Options: Options{ @@ -49,8 +49,8 @@ func TestComments(t *testing.T) { }, "ignore comments by team membership": { Comments: []*pull.Comment{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ IgnoreComments: &common.Actors{ @@ -64,8 +64,8 @@ func TestComments(t *testing.T) { }, "ignore comments by org membership": { Comments: []*pull.Comment{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ IgnoreComments: &common.Actors{ @@ -79,8 +79,8 @@ func TestComments(t *testing.T) { }, "ignore comments by permission": { Comments: []*pull.Comment{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ IgnoreComments: &common.Actors{ @@ -96,15 +96,15 @@ func TestComments(t *testing.T) { }, "do not ignore any comments": { Comments: []*pull.Comment{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, ExpectedCommentAuthors: []string{"rrandom", "iignore"}, }, "add new comment by sperson": { Comments: []*pull.Comment{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ AddComments: []Comment{ @@ -115,8 +115,8 @@ func TestComments(t *testing.T) { }, "add new comment by sperson and ignore one from iignore": { Comments: []*pull.Comment{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ AddComments: []Comment{ @@ -157,7 +157,9 @@ func TestComments(t *testing.T) { func getCommentAuthors(comments []*pull.Comment) []string { var authors []string for _, c := range comments { - authors = append(authors, c.Author) + if c.Author != nil { + authors = append(authors, c.Author.Login) + } } sort.Strings(authors) @@ -176,8 +178,8 @@ func TestReviews(t *testing.T) { }{ "ignore reviews by iignore": { Reviews: []*pull.Review{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, ExpectedReviewAuthors: []string{"rrandom"}, Options: Options{ @@ -188,8 +190,8 @@ func TestReviews(t *testing.T) { }, "ignore reviews by team membership": { Reviews: []*pull.Review{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ IgnoreReviews: &common.Actors{ @@ -203,8 +205,8 @@ func TestReviews(t *testing.T) { }, "ignore reviews by org membership": { Reviews: []*pull.Review{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ IgnoreReviews: &common.Actors{ @@ -218,8 +220,8 @@ func TestReviews(t *testing.T) { }, "ignore reviews by permission": { Reviews: []*pull.Review{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ IgnoreReviews: &common.Actors{ @@ -235,15 +237,15 @@ func TestReviews(t *testing.T) { }, "do not ignore any reviews": { Reviews: []*pull.Review{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, ExpectedReviewAuthors: []string{"rrandom", "iignore"}, }, "add new review by sperson": { Reviews: []*pull.Review{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ AddReviews: []Review{ @@ -254,8 +256,8 @@ func TestReviews(t *testing.T) { }, "add new review by sperson and ignore one from iignore": { Reviews: []*pull.Review{ - {Author: "rrandom"}, - {Author: "iignore"}, + {Author: pull.NewAuthor("rrandom")}, + {Author: pull.NewAuthor("iignore")}, }, Options: Options{ AddReviews: []Review{ @@ -295,8 +297,10 @@ func TestReviews(t *testing.T) { func getReviewAuthors(reviews []*pull.Review) []string { var authors []string - for _, c := range reviews { - authors = append(authors, c.Author) + for _, r := range reviews { + if r.Author != nil { + authors = append(authors, r.Author.Login) + } } sort.Strings(authors) diff --git a/policy/simulated/options.go b/policy/simulated/options.go index 1a104b6df..12c36f051 100644 --- a/policy/simulated/options.go +++ b/policy/simulated/options.go @@ -88,7 +88,7 @@ func (c *Comment) toPullComment() *pull.Comment { return &pull.Comment{ CreatedAt: *c.CreatedAt, LastEditedAt: *c.LastEditedAt, - Author: c.Author, + Author: pull.NewAuthor(c.Author), Body: c.Body, } } @@ -125,7 +125,7 @@ func (r *Review) toPullReview() *pull.Review { SHA: r.SHA, CreatedAt: *r.CreatedAt, LastEditedAt: *r.LastEditedAt, - Author: r.Author, + Author: pull.NewAuthor(r.Author), State: pull.ReviewState(r.State), Body: r.Body, Teams: r.Teams, diff --git a/pull/codeowners_test.go b/pull/codeowners_test.go new file mode 100644 index 000000000..f88a3f8d0 --- /dev/null +++ b/pull/codeowners_test.go @@ -0,0 +1,254 @@ +// Copyright 2018 Palantir Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pull + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestParseCodeowner(t *testing.T) { + tests := []struct { + name string + input string + expectedType string + expectedName string + }{ + { + name: "user with @", + input: "@username", + expectedType: "user", + expectedName: "username", + }, + { + name: "user without @", + input: "username", + expectedType: "user", + expectedName: "username", + }, + { + name: "team with @", + input: "@org/team-name", + expectedType: "team", + expectedName: "org/team-name", + }, + { + name: "team without @", + input: "org/team-name", + expectedType: "team", + expectedName: "org/team-name", + }, + { + name: "team with nested path", + input: "@org/parent/child-team", + expectedType: "team", + expectedName: "org/parent/child-team", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ownerType, name := ParseCodeowner(tt.input) + assert.Equal(t, tt.expectedType, ownerType) + assert.Equal(t, tt.expectedName, name) + }) + } +} + +func TestCodeownersResultAllOwners(t *testing.T) { + t.Run("nil result", func(t *testing.T) { + var result *CodeownersResult + owners := result.AllOwners() + assert.Nil(t, owners) + }) + + t.Run("empty owners", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{}, + } + owners := result.AllOwners() + assert.Empty(t, owners) + }) + + t.Run("single file single owner", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "file.go": {"@user1"}, + }, + } + owners := result.AllOwners() + assert.Equal(t, []string{"@user1"}, owners) + }) + + t.Run("multiple files with overlapping owners", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "file1.go": {"@user1", "@user2"}, + "file2.go": {"@user2", "@user3"}, + "file3.go": {"@org/team1"}, + }, + } + owners := result.AllOwners() + sort.Strings(owners) // Sort for deterministic comparison + assert.Equal(t, []string{"@org/team1", "@user1", "@user2", "@user3"}, owners) + }) + + t.Run("deduplication", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "file1.go": {"@user1", "@user1"}, + "file2.go": {"@user1"}, + }, + } + owners := result.AllOwners() + assert.Equal(t, []string{"@user1"}, owners) + }) +} + +func TestCodeownersResultOwnershipGroups(t *testing.T) { + t.Run("nil result", func(t *testing.T) { + var result *CodeownersResult + groups := result.OwnershipGroups() + assert.Nil(t, groups) + }) + + t.Run("empty owners", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{}, + } + groups := result.OwnershipGroups() + assert.Nil(t, groups) + }) + + t.Run("single file single owner", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "file.go": {"@team-a"}, + }, + } + groups := result.OwnershipGroups() + assert.Len(t, groups, 1) + assert.Equal(t, "@team-a", groups[0].Key) + assert.Equal(t, []string{"@team-a"}, groups[0].Owners) + assert.Equal(t, []string{"file.go"}, groups[0].Files) + }) + + t.Run("multiple files same owner grouped together", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "a/file1.go": {"@team-a"}, + "a/file2.go": {"@team-a"}, + "a/file3.go": {"@team-a"}, + }, + } + groups := result.OwnershipGroups() + assert.Len(t, groups, 1) + assert.Equal(t, "@team-a", groups[0].Key) + assert.Equal(t, []string{"@team-a"}, groups[0].Owners) + assert.Equal(t, []string{"a/file1.go", "a/file2.go", "a/file3.go"}, groups[0].Files) + }) + + t.Run("multiple distinct ownership groups", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@team-a"}, + "b/file.go": {"@team-b"}, + "c/file.go": {"@team-c"}, + }, + } + groups := result.OwnershipGroups() + assert.Len(t, groups, 3) + + // Groups should be sorted by key + assert.Equal(t, "@team-a", groups[0].Key) + assert.Equal(t, "@team-b", groups[1].Key) + assert.Equal(t, "@team-c", groups[2].Key) + }) + + t.Run("owner order independent grouping", func(t *testing.T) { + // Files with the same owners but listed in different order + // should be grouped together + result := &CodeownersResult{ + Owners: map[string][]string{ + "file1.go": {"@user1", "@user2"}, + "file2.go": {"@user2", "@user1"}, + }, + } + groups := result.OwnershipGroups() + assert.Len(t, groups, 1) + assert.Equal(t, "@user1,@user2", groups[0].Key) + assert.Equal(t, []string{"@user1", "@user2"}, groups[0].Owners) + assert.Equal(t, []string{"file1.go", "file2.go"}, groups[0].Files) + }) + + t.Run("mixed single and multiple owners", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "a/file.go": {"@team-a"}, + "b/file.go": {"@team-b", "@team-c"}, + "ab/file.go": {"@team-a", "@team-b"}, + "ab/file2.go": {"@team-b", "@team-a"}, // Same as above, different order + }, + } + groups := result.OwnershipGroups() + assert.Len(t, groups, 3) + + // Find each group by key + groupByKey := make(map[string]OwnershipGroup) + for _, g := range groups { + groupByKey[g.Key] = g + } + + // Single owner group + assert.Equal(t, []string{"a/file.go"}, groupByKey["@team-a"].Files) + + // Two owners group (@team-a, @team-b) - files should be grouped + abGroup := groupByKey["@team-a,@team-b"] + assert.Equal(t, []string{"@team-a", "@team-b"}, abGroup.Owners) + assert.Equal(t, []string{"ab/file.go", "ab/file2.go"}, abGroup.Files) + + // Two owners group (@team-b, @team-c) + bcGroup := groupByKey["@team-b,@team-c"] + assert.Equal(t, []string{"@team-b", "@team-c"}, bcGroup.Owners) + assert.Equal(t, []string{"b/file.go"}, bcGroup.Files) + }) + + t.Run("files with empty owners are skipped", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "file1.go": {"@team-a"}, + "file2.go": {}, + }, + } + groups := result.OwnershipGroups() + assert.Len(t, groups, 1) + assert.Equal(t, "@team-a", groups[0].Key) + }) + + t.Run("user and team owners mixed", func(t *testing.T) { + result := &CodeownersResult{ + Owners: map[string][]string{ + "file1.go": {"@johndoe", "@org/team-a"}, + "file2.go": {"@org/team-a", "@johndoe"}, // Same owners, different order + }, + } + groups := result.OwnershipGroups() + assert.Len(t, groups, 1) + assert.Equal(t, "@johndoe,@org/team-a", groups[0].Key) + assert.Equal(t, []string{"file1.go", "file2.go"}, groups[0].Files) + }) +} diff --git a/pull/context.go b/pull/context.go index eb1ac4c39..8dc5ac04b 100644 --- a/pull/context.go +++ b/pull/context.go @@ -15,6 +15,8 @@ package pull import ( + "sort" + "strings" "time" ) @@ -31,6 +33,12 @@ type MembershipContext interface { // TeamMembers returns the list of usernames in the given organization's team. TeamMembers(team string) ([]string, error) + // TeamMembersWithDetails returns team members with full metadata (avatars, URLs). + TeamMembersWithDetails(team string) ([]TeamMember, error) + + // TeamInfo returns team metadata for display purposes. + TeamInfo(team string) (*TeamInfo, error) + // OrganizationMembers returns the list of org member usernames in the given organization. OrganizationMembers(org string) ([]string, error) } @@ -137,6 +145,10 @@ type Context interface { // Labels returns a list of labels applied on the Pull Request Labels() ([]string, error) + + // Codeowners returns the codeowners for files changed in this pull request. + // Returns nil if no CODEOWNERS file exists in the repository. + Codeowners() (*CodeownersResult, error) } type FileStatus int @@ -201,10 +213,21 @@ type Signature struct { State string } +// Author represents a GitHub user who performed an action. +type Author struct { + Login string + AvatarURL string +} + +// NewAuthor creates an Author with the given login. Useful for tests. +func NewAuthor(login string) *Author { + return &Author{Login: login} +} + type Comment struct { CreatedAt time.Time LastEditedAt time.Time - Author string + Author *Author Body string } @@ -222,7 +245,7 @@ type Review struct { ID string CreatedAt time.Time LastEditedAt time.Time - Author string + Author *Author State ReviewState Body string SHA string @@ -259,7 +282,7 @@ type CollaboratorPermission struct { type Body struct { Body string CreatedAt time.Time - Author string + Author *Author LastEditedAt time.Time } @@ -267,3 +290,131 @@ type CustomProperty struct { String *string Array []string } + +// CodeownersResult contains the owners for each changed file in a pull request. +type CodeownersResult struct { + // Owners maps file paths to their owners. Owners are in the format + // "@username" for users or "@org/team" for teams. + Owners map[string][]string + + // OrphanFiles contains files that don't match any CODEOWNERS pattern. + OrphanFiles []string +} + +// HasOrphanFiles returns true if there are files without codeowners. +func (c *CodeownersResult) HasOrphanFiles() bool { + return c != nil && len(c.OrphanFiles) > 0 +} + +// AllOwners returns a deduplicated list of all owners across all files. +func (c *CodeownersResult) AllOwners() []string { + if c == nil { + return nil + } + + ownerSet := make(map[string]struct{}) + for _, fileOwners := range c.Owners { + for _, owner := range fileOwners { + ownerSet[owner] = struct{}{} + } + } + + owners := make([]string, 0, len(ownerSet)) + for owner := range ownerSet { + owners = append(owners, owner) + } + return owners +} + +// OwnersByOwner returns an inverted mapping of owner -> files. +// This is useful for displaying which files each owner is responsible for. +func (c *CodeownersResult) OwnersByOwner() map[string][]string { + if c == nil { + return nil + } + + result := make(map[string][]string) + for file, owners := range c.Owners { + for _, owner := range owners { + result[owner] = append(result[owner], file) + } + } + return result +} + +// ParseCodeowner parses a CODEOWNERS owner string and returns whether it's +// a user or team, along with the normalized name (without @ prefix). +// Examples: +// +// "@username" -> ("user", "username") +// "@org/team-name" -> ("team", "org/team-name") +func ParseCodeowner(owner string) (ownerType string, name string) { + owner = strings.TrimPrefix(owner, "@") + if strings.Contains(owner, "/") { + return "team", owner + } + return "user", owner +} + +// OwnershipGroup represents a unique set of owners for one or more files. +// Files with identical owner sets are grouped together. +type OwnershipGroup struct { + // Key is a deterministic string representation of the sorted owner set, + // used for grouping files with identical owners. + Key string + + // Owners contains the owners in this group (e.g., "@team-a", "@user1"). + Owners []string + + // Files contains the file paths that belong to this ownership group. + Files []string +} + +// OwnershipGroups returns the unique ownership groups across all changed files. +// Files with identical owner sets are grouped together. The groups are returned +// in a deterministic order based on the sorted owner keys. +func (c *CodeownersResult) OwnershipGroups() []OwnershipGroup { + if c == nil || len(c.Owners) == 0 { + return nil + } + + // Group files by their sorted owner set + groupMap := make(map[string]*OwnershipGroup) + + for file, owners := range c.Owners { + if len(owners) == 0 { + continue + } + + // Create a deterministic key by sorting owners + sortedOwners := make([]string, len(owners)) + copy(sortedOwners, owners) + sort.Strings(sortedOwners) + key := strings.Join(sortedOwners, ",") + + if group, exists := groupMap[key]; exists { + group.Files = append(group.Files, file) + } else { + groupMap[key] = &OwnershipGroup{ + Key: key, + Owners: sortedOwners, + Files: []string{file}, + } + } + } + + // Convert map to slice and sort for deterministic output + groups := make([]OwnershipGroup, 0, len(groupMap)) + for _, group := range groupMap { + // Sort files within each group for deterministic output + sort.Strings(group.Files) + groups = append(groups, *group) + } + + // Sort groups by key for deterministic output + sort.Slice(groups, func(i, j int) bool { + return groups[i].Key < groups[j].Key + }) + + return groups +} diff --git a/pull/github.go b/pull/github.go index 0eb6b35a1..d2be9c788 100644 --- a/pull/github.go +++ b/pull/github.go @@ -20,9 +20,11 @@ import ( "net/http" "slices" "strings" + "sync" "time" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" + "github.com/hairyhenderson/go-codeowners" "github.com/pkg/errors" "github.com/shurcooL/githubv4" ) @@ -146,6 +148,10 @@ type GitHubContext struct { pushedAt map[string]time.Time workflowRuns map[string][]string repositoryCustomProperties map[string]CustomProperty + + codeownersResult *CodeownersResult + codeownersLoaded bool + codeownersErr error } // NewGitHubContext creates a new pull.Context that makes GitHub requests to @@ -266,7 +272,7 @@ func (ghc *GitHubContext) Body() (*Body, error) { return &Body{ Body: graphqlResponse.Body, CreatedAt: graphqlResponse.CreatedAt, - Author: graphqlResponse.Author.GetV3Login(), + Author: graphqlResponse.Author.ToAuthor(), LastEditedAt: graphqlResponse.LastEditedAt, }, nil } @@ -536,7 +542,7 @@ func (ghc *GitHubContext) RepositoryCollaborators(minPermission Permission) ([]* } for _, u := range users { - directPerms[u.GetLogin()] = ParsePermissionMap(u.GetPermissions()) + directPerms[u.GetLogin()] = ParseRepositoryPermissions(u.GetPermissions()) } if resp.NextPage == 0 { @@ -561,7 +567,7 @@ func (ghc *GitHubContext) RepositoryCollaborators(minPermission Permission) ([]* collaborators = append(collaborators, &Collaborator{ Name: u.GetLogin(), Permissions: []CollaboratorPermission{ - {Permission: ParsePermissionMap(u.GetPermissions())}, + {Permission: ParseRepositoryPermissions(u.GetPermissions())}, }, }) } @@ -577,16 +583,32 @@ func (ghc *GitHubContext) RepositoryCollaborators(minPermission Permission) ([]* return nil, err } + // Fetch team members in parallel teamMembership := make(map[string][]string) + var membershipMu sync.Mutex + var membershipWg sync.WaitGroup + var membershipErr error + var errOnce sync.Once + for team := range teamPerms { - members, err := ghc.TeamMembers(ghc.owner + "/" + team) - if err != nil { - return nil, err - } + membershipWg.Go(func() { + members, err := ghc.TeamMembers(ghc.owner + "/" + team) + if err != nil { + errOnce.Do(func() { membershipErr = err }) + return + } + membershipMu.Lock() + for _, member := range members { + teamMembership[member] = append(teamMembership[member], team) + } + membershipMu.Unlock() + }) + } - for _, member := range members { - teamMembership[member] = append(teamMembership[member], team) - } + membershipWg.Wait() + + if membershipErr != nil { + return nil, membershipErr } fillPermissions := func(c *Collaborator) { @@ -959,6 +981,138 @@ func (ghc *GitHubContext) Labels() ([]string, error) { return ghc.labels, nil } +// codeownersLocations are the standard locations for CODEOWNERS files +// as documented by GitHub. +var codeownersLocations = []string{ + ".github/CODEOWNERS", + "CODEOWNERS", + "docs/CODEOWNERS", +} + +func (ghc *GitHubContext) Codeowners() (*CodeownersResult, error) { + if ghc.codeownersLoaded { + return ghc.codeownersResult, ghc.codeownersErr + } + ghc.codeownersLoaded = true + + // Load CODEOWNERS from the base branch (not the PR head) for security + co, err := ghc.loadCodeowners() + if err != nil { + ghc.codeownersErr = err + return nil, ghc.codeownersErr + } + + // No CODEOWNERS file found + if co == nil { + return nil, nil + } + + // Get changed files and compute owners for each + files, err := ghc.ChangedFiles() + if err != nil { + ghc.codeownersErr = errors.Wrap(err, "failed to get changed files for codeowners") + return nil, ghc.codeownersErr + } + + result := &CodeownersResult{ + Owners: make(map[string][]string), + } + for _, f := range files { + owners := co.Owners(f.Filename) + if len(owners) > 0 { + result.Owners[f.Filename] = owners + } else { + result.OrphanFiles = append(result.OrphanFiles, f.Filename) + } + } + + ghc.codeownersResult = result + return result, nil +} + +// loadCodeowners attempts to load the CODEOWNERS file from the base branch. +// It uses the base branch ref to prevent PRs from modifying their own approval +// requirements by changing CODEOWNERS in the PR. Returns nil if no CODEOWNERS +// file exists. +func (ghc *GitHubContext) loadCodeowners() (*codeowners.Codeowners, error) { + baseRef := ghc.pr.BaseRefOID + repoID := ghc.pr.BaseRepository.DatabaseID + + // Check cache for parsed CODEOWNERS content + if gc := ghc.globalCache; gc != nil { + if co, ok := gc.GetCodeowners(repoID, baseRef); ok { + return co, nil + } + } + + type codeownersFetchResult struct { + co *codeowners.Codeowners + err error + } + results := make([]codeownersFetchResult, len(codeownersLocations)) + var wg sync.WaitGroup + + for i, path := range codeownersLocations { + wg.Go(func() { + co, err := ghc.fetchCodeowners(path, baseRef) + results[i] = codeownersFetchResult{co: co, err: err} + }) + } + wg.Wait() + + // Return first result by priority order (check errors and results together) + for _, r := range results { + if r.err != nil { + return nil, r.err + } + if r.co != nil { + if gc := ghc.globalCache; gc != nil { + gc.SetCodeowners(repoID, baseRef, r.co) + } + return r.co, nil + } + } + + return nil, nil +} + +// fetchCodeowners retrieves and parses a CODEOWNERS file at the given path and ref. +// Returns nil without error if the file does not exist. +func (ghc *GitHubContext) fetchCodeowners(path, ref string) (*codeowners.Codeowners, error) { + content, exists, err := ghc.getFileContent(path, ref) + if err != nil { + return nil, errors.Wrapf(err, "failed to fetch %s", path) + } + if !exists { + return nil, nil + } + + co, err := codeowners.FromReader(strings.NewReader(content), "") + if err != nil { + return nil, errors.Wrapf(err, "failed to parse %s", path) + } + return co, nil +} + +func (ghc *GitHubContext) getFileContent(path, ref string) (string, bool, error) { + file, _, _, err := ghc.client.Repositories.GetContents( + ghc.ctx, ghc.owner, ghc.repo, path, + &github.RepositoryContentGetOptions{Ref: ref}, + ) + if err != nil { + if isNotFound(err) { + return "", false, nil + } + return "", false, err + } + + content, err := file.GetContent() + if err != nil { + return "", false, err + } + return content, true, nil +} + func (ghc *GitHubContext) loadPagedData() error { // This query is tuned to use a single GraphQL rate limit point per // execution. For most PRs, this means loading all commits, comments, and @@ -1110,6 +1264,7 @@ type v4PullRequest struct { Owner v4Actor } + BaseRefOID string BaseRefName string BaseRepository struct { DatabaseID int64 @@ -1170,7 +1325,7 @@ func (r *v4PullRequestReview) ToReview() *Review { ID: r.ID, CreatedAt: r.SubmittedAt, LastEditedAt: r.LastEditedAt, - Author: r.Author.GetV3Login(), + Author: r.Author.ToAuthor(), State: ReviewState(strings.ToLower(r.State)), Body: r.Body, SHA: r.Commit.OID, @@ -1182,7 +1337,7 @@ func (r *v4PullRequestReview) ToComment() *Comment { return &Comment{ CreatedAt: r.SubmittedAt, LastEditedAt: r.LastEditedAt, - Author: r.Author.GetV3Login(), + Author: r.Author.ToAuthor(), Body: r.Body, } } @@ -1198,7 +1353,7 @@ func (c *v4IssueComment) ToComment() *Comment { return &Comment{ CreatedAt: c.CreatedAt, LastEditedAt: c.LastEditedAt, - Author: c.Author.GetV3Login(), + Author: c.Author.ToAuthor(), Body: c.Body, } } @@ -1266,8 +1421,9 @@ type v4Team struct { } type v4Actor struct { - Type string `graphql:"__typename"` - Login string + Type string `graphql:"__typename"` + Login string + AvatarURL string `graphql:"avatarUrl"` } // GetV3Login returns a V3-compatible login string. These login strings contain @@ -1282,6 +1438,25 @@ func (a *v4Actor) GetV3Login() string { return a.Login } +// GetAvatarURL returns the actor's avatar URL. +func (a *v4Actor) GetAvatarURL() string { + if a == nil { + return "" + } + return a.AvatarURL +} + +// ToAuthor converts the actor to an Author struct. +func (a *v4Actor) ToAuthor() *Author { + if a == nil { + return nil + } + return &Author{ + Login: a.GetV3Login(), + AvatarURL: a.AvatarURL, + } +} + type v4GitActor struct { User *v4Actor } diff --git a/pull/github_membership.go b/pull/github_membership.go index 711406aef..e3893b16c 100644 --- a/pull/github_membership.go +++ b/pull/github_membership.go @@ -17,27 +17,42 @@ package pull import ( "context" "strings" + "sync" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/pkg/errors" ) type GitHubMembershipContext struct { - ctx context.Context - client *github.Client + ctx context.Context + client *github.Client + globalCache GlobalCache - membership map[string]bool - orgMembers map[string][]string - teamMembers map[string][]string + membership sync.Map // map[string]bool + orgMembers sync.Map // map[string][]string + teamMembers sync.Map // map[string][]string + teamData sync.Map // map[string]*teamLoader } -func NewGitHubMembershipContext(ctx context.Context, client *github.Client) *GitHubMembershipContext { +// cachedTeamData holds rich team data including member details +type cachedTeamData struct { + Info *TeamInfo + Members []TeamMember +} + +// teamLoader coordinates loading of team data to prevent duplicate API calls +type teamLoader struct { + once sync.Once + data *cachedTeamData + err error +} + +func NewGitHubMembershipContext(ctx context.Context, client *github.Client, globalCache GlobalCache) *GitHubMembershipContext { return &GitHubMembershipContext{ ctx: ctx, client: client, - membership: make(map[string]bool), - orgMembers: make(map[string][]string), - teamMembers: make(map[string][]string), + globalCache: globalCache, + // sync.Map zero value is ready to use } } @@ -56,23 +71,85 @@ func splitTeam(team string) (org, slug string, err error) { func (mc *GitHubMembershipContext) IsTeamMember(team, user string) (bool, error) { key := membershipKey(team, user) - org, slug, err := splitTeam(team) + // Check per-request cache first (fast path) + if val, ok := mc.membership.Load(key); ok { + return val.(bool), nil + } + + // Check global caches + if mc.globalCache != nil { + if isMember, found := mc.checkGlobalCaches(key, team, user); found { + return isMember, nil + } + } + + // Fetch full team members list (batch approach is more efficient for multiple checks) + data, err := mc.loadTeamWithMembers(team) if err != nil { - return false, err + // Fall back to individual API call on error + return mc.checkTeamMembershipViaAPI(key, team, user) } - isMember, ok := mc.membership[key] - if ok { - return isMember, nil + // populateLocalCaches already stored true for all members, but we need to + // also store false for non-members to avoid re-checking the list + isMember := mc.findMemberInList(data.Members, user) + if !isMember { + mc.membership.Store(key, false) + } + return isMember, nil +} + +// checkGlobalCaches checks both team members cache and individual membership cache. +// Returns (isMember, found) where found indicates if a cached value was found. +func (mc *GitHubMembershipContext) checkGlobalCaches(key, team, user string) (bool, bool) { + // Check full team members list first + if members, _, found := mc.globalCache.GetTeamMembers(team); found { + isMember := mc.findMemberInList(members, user) + mc.membership.Store(key, isMember) + return isMember, true + } + + // Fall back to individual membership cache + if isMember, found := mc.globalCache.GetTeamMembership(team, user); found { + mc.membership.Store(key, isMember) + return isMember, true + } + + return false, false +} + +// findMemberInList searches for a user in a team member list using case-insensitive comparison. +func (mc *GitHubMembershipContext) findMemberInList(members []TeamMember, user string) bool { + for _, m := range members { + if strings.EqualFold(m.Login, user) { + return true + } + } + return false +} + +// checkTeamMembershipViaAPI checks team membership using individual API call. +// Used as fallback when batch fetch fails. +func (mc *GitHubMembershipContext) checkTeamMembershipViaAPI(key, team, user string) (bool, error) { + org, slug, err := splitTeam(team) + if err != nil { + return false, err } membership, _, err := mc.client.Teams.GetTeamMembershipBySlug(mc.ctx, org, slug, user) - if err != nil && !isNotFound(err) { + if err != nil { + if isNotFound(err) { + mc.membership.Store(key, false) + return false, nil + } return false, errors.Wrap(err, "failed to get team membership") } - isMember = membership != nil && membership.GetState() == "active" - mc.membership[key] = isMember + isMember := membership.GetState() == "active" + mc.membership.Store(key, isMember) + if mc.globalCache != nil { + mc.globalCache.SetTeamMembership(team, user, isMember) + } return isMember, nil } @@ -80,9 +157,8 @@ func (mc *GitHubMembershipContext) IsTeamMember(team, user string) (bool, error) func (mc *GitHubMembershipContext) IsOrgMember(org, user string) (bool, error) { key := membershipKey(org, user) - isMember, ok := mc.membership[key] - if ok { - return isMember, nil + if val, ok := mc.membership.Load(key); ok { + return val.(bool), nil } isMember, _, err := mc.client.Organizations.IsMember(mc.ctx, org, user) @@ -90,69 +166,194 @@ func (mc *GitHubMembershipContext) IsOrgMember(org, user string) (bool, error) { return false, errors.Wrap(err, "failed to get organization membership") } - mc.membership[key] = isMember + mc.membership.Store(key, isMember) return isMember, nil } func (mc *GitHubMembershipContext) OrganizationMembers(org string) ([]string, error) { - members, ok := mc.orgMembers[org] - if !ok { - opt := &github.ListMembersOptions{ - ListOptions: github.ListOptions{ - PerPage: 100, - }, - } + if val, ok := mc.orgMembers.Load(org); ok { + return val.([]string), nil + } - for { - users, resp, err := mc.client.Organizations.ListMembers(mc.ctx, org, opt) - if err != nil { - return nil, errors.Wrapf(err, "failed to list members of org %s page %d", org, opt.Page) - } - for _, u := range users { - members = append(members, u.GetLogin()) - // And cache these values for later lookups - mc.membership[membershipKey(org, u.GetLogin())] = true - } - if resp.NextPage == 0 { - break - } - opt.Page = resp.NextPage + opt := &github.ListMembersOptions{ + ListOptions: github.ListOptions{ + PerPage: 100, + }, + } + + var members []string + for { + users, resp, err := mc.client.Organizations.ListMembers(mc.ctx, org, opt) + if err != nil { + return nil, errors.Wrapf(err, "failed to list members of org %s page %d", org, opt.Page) + } + for _, u := range users { + members = append(members, u.GetLogin()) + // And cache these values for later lookups + mc.membership.Store(membershipKey(org, u.GetLogin()), true) } - mc.orgMembers[org] = members + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage } + mc.orgMembers.Store(org, members) return members, nil } func (mc *GitHubMembershipContext) TeamMembers(team string) ([]string, error) { - members, ok := mc.teamMembers[team] - if !ok { - opt := &github.TeamListTeamMembersOptions{ - ListOptions: github.ListOptions{ - PerPage: 100, - }, + if val, ok := mc.teamMembers.Load(team); ok { + return val.([]string), nil + } + + org, slug, err := splitTeam(team) + if err != nil { + return nil, err + } + + opt := &github.TeamListTeamMembersOptions{ + ListOptions: github.ListOptions{PerPage: 100}, + } + + var members []string + for { + users, resp, err := mc.client.Teams.ListTeamMembersBySlug(mc.ctx, org, slug, opt) + if err != nil { + return nil, errors.Wrapf(err, "failed to list team %s members page %d", team, opt.Page) + } + for _, u := range users { + login := u.GetLogin() + members = append(members, login) + mc.membership.Store(membershipKey(team, login), true) + } + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + mc.teamMembers.Store(team, members) + return members, nil +} + +// loadTeamWithMembers fetches and caches team data with full member details. +// It checks global cache first, then uses sync.Once to deduplicate concurrent API calls. +func (mc *GitHubMembershipContext) loadTeamWithMembers(team string) (*cachedTeamData, error) { + // Check global cache first (shared across requests) + if mc.globalCache != nil { + if members, info, found := mc.globalCache.GetTeamMembers(team); found { + mc.populateLocalCaches(team, members) + return &cachedTeamData{Info: info, Members: members}, nil } + } + + // Use LoadOrStore to get-or-create a loader, ensuring only one fetch per team + loaderVal, _ := mc.teamData.LoadOrStore(team, &teamLoader{}) + loader := loaderVal.(*teamLoader) + + // Execute the fetch exactly once + loader.once.Do(func() { + loader.data, loader.err = mc.fetchTeamFromAPI(team) + }) + + return loader.data, loader.err +} + +// populateLocalCaches updates per-request caches from team member data. +func (mc *GitHubMembershipContext) populateLocalCaches(team string, members []TeamMember) { + usernames := make([]string, len(members)) + for i, m := range members { + mc.membership.Store(membershipKey(team, m.Login), true) + usernames[i] = m.Login + } + mc.teamMembers.Store(team, usernames) +} + +// fetchTeamFromAPI fetches team info and members from the GitHub API in parallel. +func (mc *GitHubMembershipContext) fetchTeamFromAPI(team string) (*cachedTeamData, error) { + org, slug, err := splitTeam(team) + if err != nil { + return nil, err + } - org, slug, err := splitTeam(team) + var teamObj *github.Team + var members []TeamMember + var teamErr, membersErr error + var wg sync.WaitGroup + + // Fetch team info + wg.Go(func() { + t, _, err := mc.client.Teams.GetTeamBySlug(mc.ctx, org, slug) if err != nil { - return nil, err + teamErr = errors.Wrap(err, "failed to get team info") + return } + teamObj = t + }) + // Fetch team members + wg.Go(func() { + opt := &github.TeamListTeamMembersOptions{ + ListOptions: github.ListOptions{PerPage: 100}, + } for { users, resp, err := mc.client.Teams.ListTeamMembersBySlug(mc.ctx, org, slug, opt) if err != nil { - return nil, errors.Wrapf(err, "failed to list team %s members page %d", team, opt.Page) + membersErr = errors.Wrapf(err, "failed to list team %s members page %d", team, opt.Page) + return } for _, u := range users { - members = append(members, u.GetLogin()) - // And cache these values for later lookups - mc.membership[membershipKey(team, u.GetLogin())] = true + members = append(members, TeamMember{ + Login: u.GetLogin(), + AvatarURL: u.GetAvatarURL(), + HTMLURL: u.GetHTMLURL(), + }) } if resp.NextPage == 0 { break } opt.Page = resp.NextPage } - mc.teamMembers[team] = members + }) + + wg.Wait() + + // Return first error encountered + if teamErr != nil { + return nil, teamErr } - return members, nil + if membersErr != nil { + return nil, membersErr + } + + info := &TeamInfo{ + ID: teamObj.GetID(), + Slug: teamObj.GetSlug(), + HTMLURL: teamObj.GetHTMLURL(), + } + + mc.populateLocalCaches(team, members) + + if mc.globalCache != nil { + mc.globalCache.SetTeamMembers(team, info, members) + } + + return &cachedTeamData{Info: info, Members: members}, nil +} + +// TeamMembersWithDetails returns team members with full metadata (avatars, URLs). +func (mc *GitHubMembershipContext) TeamMembersWithDetails(team string) ([]TeamMember, error) { + data, err := mc.loadTeamWithMembers(team) + if err != nil { + return nil, err + } + return data.Members, nil +} + +// TeamInfo returns team metadata for display purposes. +func (mc *GitHubMembershipContext) TeamInfo(team string) (*TeamInfo, error) { + data, err := mc.loadTeamWithMembers(team) + if err != nil { + return nil, err + } + return data.Info, nil } diff --git a/pull/github_test.go b/pull/github_test.go index 11b775909..a69a94148 100644 --- a/pull/github_test.go +++ b/pull/github_test.go @@ -23,7 +23,8 @@ import ( "testing" "time" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" + "github.com/hairyhenderson/go-codeowners" "github.com/shurcooL/githubv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -176,19 +177,19 @@ func TestReviews(t *testing.T) { expectedTime, err := time.Parse(time.RFC3339, "2018-06-27T20:33:26Z") assert.NoError(t, err) - assert.Equal(t, "mhaypenny", reviews[0].Author) + assert.Equal(t, "mhaypenny", reviews[0].Author.Login) assert.Equal(t, expectedTime, reviews[0].CreatedAt) assert.Equal(t, expectedTime, reviews[0].LastEditedAt) assert.Equal(t, ReviewChangesRequested, reviews[0].State) assert.Equal(t, "", reviews[0].Body) - assert.Equal(t, "bkeyes", reviews[1].Author) + assert.Equal(t, "bkeyes", reviews[1].Author.Login) assert.Equal(t, expectedTime.Add(time.Second), reviews[1].CreatedAt) assert.Equal(t, expectedTime.Add(time.Second), reviews[1].LastEditedAt) assert.Equal(t, ReviewApproved, reviews[1].State) assert.Equal(t, "the body", reviews[1].Body) - assert.Equal(t, "jgiannuzzi", reviews[2].Author) + assert.Equal(t, "jgiannuzzi", reviews[2].Author.Login) assert.Equal(t, expectedTime.Add(-4*time.Second).Add(5*time.Minute), reviews[2].CreatedAt) assert.Equal(t, expectedTime.Add(-4*time.Second).Add(5*time.Minute), reviews[2].LastEditedAt) assert.Equal(t, ReviewCommented, reviews[2].State) @@ -240,7 +241,7 @@ func TestBody(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "/no-platform", prBody.Body) - assert.Equal(t, "agirlnamedsophia", prBody.Author) + assert.Equal(t, "agirlnamedsophia", prBody.Author.Login) assert.Equal(t, expectedTime, prBody.CreatedAt) assert.Equal(t, expectedTime, prBody.LastEditedAt) } @@ -263,22 +264,22 @@ func TestComments(t *testing.T) { expectedTime, err := time.Parse(time.RFC3339, "2018-06-27T20:28:22Z") assert.NoError(t, err) - assert.Equal(t, "bkeyes", comments[0].Author) + assert.Equal(t, "bkeyes", comments[0].Author.Login) assert.Equal(t, expectedTime, comments[0].CreatedAt) assert.Equal(t, expectedTime, comments[0].LastEditedAt) assert.Equal(t, ":+1:", comments[0].Body) - assert.Equal(t, "mhaypenny", comments[1].Author) + assert.Equal(t, "mhaypenny", comments[1].Author.Login) assert.Equal(t, expectedTime.Add(30*time.Second), comments[1].CreatedAt) assert.Equal(t, expectedTime.Add(30*time.Second), comments[1].LastEditedAt) assert.Equal(t, "I comment!", comments[1].Body) - assert.Equal(t, "bulldozer[bot]", comments[2].Author) + assert.Equal(t, "bulldozer[bot]", comments[2].Author.Login) assert.Equal(t, expectedTime.Add(time.Minute), comments[2].CreatedAt) assert.Equal(t, expectedTime.Add(time.Minute), comments[2].LastEditedAt) assert.Equal(t, "I merge!", comments[2].Body) - assert.Equal(t, "jgiannuzzi", comments[3].Author) + assert.Equal(t, "jgiannuzzi", comments[3].Author.Login) assert.Equal(t, expectedTime.Add(10*time.Minute), comments[3].CreatedAt) assert.Equal(t, expectedTime.Add(10*time.Minute), comments[3].LastEditedAt) assert.Equal(t, "A review comment", comments[3].Body) @@ -444,7 +445,7 @@ func TestCrossRepoBranches(t *testing.T) { // change the source repo to a forked repo crossRepoPr := defaultTestPR() crossRepoPr.Head.Repo = &github.Repository{ - ID: github.Int64(12345), + ID: new(int64(12345)), Owner: &github.User{ Login: new("testorg2"), }, @@ -725,7 +726,7 @@ func makeContext(t *testing.T, rp *ResponsePlayer, pr *github.PullRequest, gc Gl base, _ := url.Parse("http://github.localhost/") client.BaseURL = base - mbrCtx := NewGitHubMembershipContext(ctx, client) + mbrCtx := NewGitHubMembershipContext(ctx, client, gc) if pr == nil { pr = defaultTestPR() } @@ -755,7 +756,7 @@ func defaultTestPR() *github.PullRequest { Ref: new("test-branch"), SHA: new("e05fcae367230ee709313dd2720da527d178ce43"), Repo: &github.Repository{ - ID: github.Int64(1234), + ID: new(int64(1234)), Owner: &github.User{ Login: new("testorg"), }, @@ -765,7 +766,7 @@ func defaultTestPR() *github.PullRequest { Base: &github.PullRequestBranch{ Ref: new("develop"), Repo: &github.Repository{ - ID: github.Int64(1234), + ID: new(int64(1234)), Owner: &github.User{ Login: new("testorg"), }, @@ -777,12 +778,29 @@ func defaultTestPR() *github.PullRequest { } type MockGlobalCache struct { - PushedAt map[string]time.Time + PushedAt map[string]time.Time + Codeowners map[string]*codeowners.Codeowners + Membership map[string]mockMembershipEntry + Teams map[string]mockTeamMembersEntry +} + +type mockTeamMembersEntry struct { + info *TeamInfo + members []TeamMember + expiresAt time.Time +} + +type mockMembershipEntry struct { + isMember bool + expiresAt time.Time } func NewMockGlobalCache() *MockGlobalCache { return &MockGlobalCache{ - PushedAt: make(map[string]time.Time), + PushedAt: make(map[string]time.Time), + Codeowners: make(map[string]*codeowners.Codeowners), + Membership: make(map[string]mockMembershipEntry), + Teams: make(map[string]mockTeamMembersEntry), } } @@ -794,3 +812,49 @@ func (c *MockGlobalCache) GetPushedAt(repoID int64, sha string) (time.Time, bool func (c *MockGlobalCache) SetPushedAt(repoID int64, sha string, t time.Time) { c.PushedAt[fmt.Sprintf("%d:%s", repoID, sha)] = t } + +func (c *MockGlobalCache) GetCodeowners(repoID int64, baseRefOID string) (*codeowners.Codeowners, bool) { + key := fmt.Sprintf("%d:%s", repoID, baseRefOID) + co, ok := c.Codeowners[key] + return co, ok +} + +func (c *MockGlobalCache) SetCodeowners(repoID int64, baseRefOID string, co *codeowners.Codeowners) { + key := fmt.Sprintf("%d:%s", repoID, baseRefOID) + c.Codeowners[key] = co +} + +func (c *MockGlobalCache) GetTeamMembership(team, user string) (bool, bool) { + key := team + ":" + user + if entry, ok := c.Membership[key]; ok { + if time.Now().Before(entry.expiresAt) { + return entry.isMember, true + } + } + return false, false +} + +func (c *MockGlobalCache) SetTeamMembership(team, user string, isMember bool) { + key := team + ":" + user + c.Membership[key] = mockMembershipEntry{ + isMember: isMember, + expiresAt: time.Now().Add(5 * time.Minute), + } +} + +func (c *MockGlobalCache) GetTeamMembers(team string) ([]TeamMember, *TeamInfo, bool) { + if entry, ok := c.Teams[team]; ok { + if time.Now().Before(entry.expiresAt) { + return entry.members, entry.info, true + } + } + return nil, nil, false +} + +func (c *MockGlobalCache) SetTeamMembers(team string, info *TeamInfo, members []TeamMember) { + c.Teams[team] = mockTeamMembersEntry{ + info: info, + members: members, + expiresAt: time.Now().Add(5 * time.Minute), + } +} diff --git a/pull/global_cache.go b/pull/global_cache.go index 0eeb5a9bf..31160d548 100644 --- a/pull/global_cache.go +++ b/pull/global_cache.go @@ -18,9 +18,26 @@ import ( "fmt" "time" + "github.com/hairyhenderson/go-codeowners" lru "github.com/hashicorp/golang-lru" ) +const DefaultMembershipTTL = 5 * time.Minute + +// TeamMember represents a GitHub user with basic metadata +type TeamMember struct { + Login string + AvatarURL string + HTMLURL string +} + +// TeamInfo represents team metadata +type TeamInfo struct { + ID int64 + Slug string + HTMLURL string +} + // GlobalCache implementations provide a way to cache values that are safe to // cache at the application level. Values in the global cache should not become // stale due to external changes and should only expire to prevent the cache @@ -28,21 +45,70 @@ import ( type GlobalCache interface { GetPushedAt(repoID int64, sha string) (time.Time, bool) SetPushedAt(repoID int64, sha string, t time.Time) + + // GetCodeowners returns the cached parsed CODEOWNERS for a repository at a + // specific base branch commit. Since commit SHAs are immutable, caching the + // parsed content is safe and avoids repeated HTTP requests. + GetCodeowners(repoID int64, baseRefOID string) (*codeowners.Codeowners, bool) + SetCodeowners(repoID int64, baseRefOID string, co *codeowners.Codeowners) + + // GetTeamMembership returns cached team membership status. + // Returns (isMember, found). If found is false, the value is not in cache. + GetTeamMembership(team, user string) (bool, bool) + SetTeamMembership(team, user string, isMember bool) + + // GetTeamMembers returns cached team members with metadata. + // Returns (members, info, found). If found is false, the value is not in cache. + GetTeamMembers(team string) ([]TeamMember, *TeamInfo, bool) + SetTeamMembers(team string, info *TeamInfo, members []TeamMember) +} + +type membershipEntry struct { + isMember bool + expiresAt time.Time +} + +type teamMembersEntry struct { + info *TeamInfo + members []TeamMember + expiresAt time.Time } // LRUGlobalCache is a GlobalCache where each data type is stored in a separate // LRU cache. This prevents frequently used data of one type from evicting less // frequently used data of a different type. type LRUGlobalCache struct { - pushedAt *lru.Cache + pushedAt *lru.Cache + codeowners *lru.Cache + membership *lru.Cache + teams *lru.Cache + memberTTL time.Duration } -func NewLRUGlobalCache(pushedAtSize int) (*LRUGlobalCache, error) { +func NewLRUGlobalCache(pushedAtSize, codeownersSize, membershipSize, teamsSize int) (*LRUGlobalCache, error) { pushedAt, err := lru.New(pushedAtSize) if err != nil { return nil, err } - return &LRUGlobalCache{pushedAt: pushedAt}, nil + codeownersCache, err := lru.New(codeownersSize) + if err != nil { + return nil, err + } + membership, err := lru.New(membershipSize) + if err != nil { + return nil, err + } + teams, err := lru.New(teamsSize) + if err != nil { + return nil, err + } + return &LRUGlobalCache{ + pushedAt: pushedAt, + codeowners: codeownersCache, + membership: membership, + teams: teams, + memberTTL: DefaultMembershipTTL, + }, nil } func (c *LRUGlobalCache) GetPushedAt(repoID int64, sha string) (time.Time, bool) { @@ -61,3 +127,61 @@ func (c *LRUGlobalCache) SetPushedAt(repoID int64, sha string, t time.Time) { func pushedAtKey(repoID int64, sha string) string { return fmt.Sprintf("%d:%s", repoID, sha) } + +func (c *LRUGlobalCache) GetCodeowners(repoID int64, baseRefOID string) (*codeowners.Codeowners, bool) { + key := fmt.Sprintf("%d:%s", repoID, baseRefOID) + if val, ok := c.codeowners.Get(key); ok { + if co, ok := val.(*codeowners.Codeowners); ok { + return co, true + } + } + return nil, false +} + +func (c *LRUGlobalCache) SetCodeowners(repoID int64, baseRefOID string, co *codeowners.Codeowners) { + key := fmt.Sprintf("%d:%s", repoID, baseRefOID) + c.codeowners.Add(key, co) +} + +func (c *LRUGlobalCache) GetTeamMembership(team, user string) (bool, bool) { + key := team + ":" + user + if val, ok := c.membership.Get(key); ok { + if entry, ok := val.(membershipEntry); ok { + if time.Now().Before(entry.expiresAt) { + return entry.isMember, true + } + // Expired - remove and return not found + c.membership.Remove(key) + } + } + return false, false +} + +func (c *LRUGlobalCache) SetTeamMembership(team, user string, isMember bool) { + key := team + ":" + user + c.membership.Add(key, membershipEntry{ + isMember: isMember, + expiresAt: time.Now().Add(c.memberTTL), + }) +} + +func (c *LRUGlobalCache) GetTeamMembers(team string) ([]TeamMember, *TeamInfo, bool) { + if val, ok := c.teams.Get(team); ok { + if entry, ok := val.(teamMembersEntry); ok { + if time.Now().Before(entry.expiresAt) { + return entry.members, entry.info, true + } + // Expired - remove and return not found + c.teams.Remove(team) + } + } + return nil, nil, false +} + +func (c *LRUGlobalCache) SetTeamMembers(team string, info *TeamInfo, members []TeamMember) { + c.teams.Add(team, teamMembersEntry{ + info: info, + members: members, + expiresAt: time.Now().Add(c.memberTTL), + }) +} diff --git a/pull/list_teams.go b/pull/list_teams.go index 989b9cd89..f74110f68 100644 --- a/pull/list_teams.go +++ b/pull/list_teams.go @@ -20,7 +20,7 @@ import ( "net/url" "reflect" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/google/go-querystring/query" ) diff --git a/pull/permission.go b/pull/permission.go index 55df3ba97..312b8db6d 100644 --- a/pull/permission.go +++ b/pull/permission.go @@ -17,6 +17,8 @@ package pull import ( "fmt" "strings" + + "github.com/google/go-github/v85/github" ) type Permission uint8 @@ -52,6 +54,22 @@ func ParsePermissionMap(m map[string]bool) Permission { return PermissionNone } +func ParseRepositoryPermissions(p *github.RepositoryPermissions) Permission { + switch { + case p.GetAdmin(): + return PermissionAdmin + case p.GetMaintain(): + return PermissionMaintain + case p.GetPush(): + return PermissionWrite + case p.GetTriage(): + return PermissionTriage + case p.GetPull(): + return PermissionRead + } + return PermissionNone +} + func (p Permission) String() string { switch p { case PermissionNone: diff --git a/pull/pulltest/context.go b/pull/pulltest/context.go index 8a5a02178..116b087bb 100644 --- a/pull/pulltest/context.go +++ b/pull/pulltest/context.go @@ -81,6 +81,9 @@ type Context struct { RepositoryCustomPropertiesValue map[string]pull.CustomProperty RepositoryCustomPropertiesError error + CodeownersValue *pull.CodeownersResult + CodeownersError error + Draft bool } @@ -239,6 +242,36 @@ func (c *Context) TeamMembers(team string) ([]string, error) { return inverted[team], nil } +func (c *Context) TeamMembersWithDetails(team string) ([]pull.TeamMember, error) { + if c.TeamMembershipError != nil { + return nil, c.TeamMembershipError + } + + members, err := c.TeamMembers(team) + if err != nil { + return nil, err + } + + result := make([]pull.TeamMember, len(members)) + for i, login := range members { + result[i] = pull.TeamMember{Login: login} + } + return result, nil +} + +func (c *Context) TeamInfo(team string) (*pull.TeamInfo, error) { + if c.TeamMembershipError != nil { + return nil, c.TeamMembershipError + } + + // Return basic team info from the team string + return &pull.TeamInfo{ + ID: 0, + Slug: team, + HTMLURL: "", + }, nil +} + func (c *Context) RequestedReviewers() ([]*pull.Reviewer, error) { return c.RequestedReviewersValue, c.RequestedReviewersError } @@ -271,5 +304,9 @@ func (c *Context) RepositoryCustomProperties() (map[string]pull.CustomProperty, return c.RepositoryCustomPropertiesValue, c.RepositoryCustomPropertiesError } +func (c *Context) Codeowners() (*pull.CodeownersResult, error) { + return c.CodeownersValue, c.CodeownersError +} + // assert that the test object implements the full interface var _ pull.Context = &Context{} diff --git a/server/assets/css/main.css b/server/assets/css/main.css index d6ae32b6e..ce05e8060 100644 --- a/server/assets/css/main.css +++ b/server/assets/css/main.css @@ -154,6 +154,26 @@ details summary > * { .status-stripe.skipped { @apply border-gray3; } .status-stripe.error { @apply border-red3; } +.status-dot { + @apply inline-block w-2 h-2 rounded-full mr-1; + vertical-align: middle; +} +.status-dot.approved { @apply bg-green3; } +.status-dot.pending { @apply bg-orange3; } + +.ownership-groups { + @apply flex flex-col gap-1 mt-2; +} +.ownership-group { + @apply flex items-center text-sm; +} +.ownership-group .group-owner { + @apply font-mono text-sm-mono; +} +.ownership-group .group-approvers { + @apply text-dark-gray3 ml-1; +} + .hero { @apply p-8 bg-dark-gray5; background-image: diff --git a/server/config.go b/server/config.go index 6f078d7d8..a154f5e90 100644 --- a/server/config.go +++ b/server/config.go @@ -71,6 +71,19 @@ type CachingConfig struct { // The size of the global cache for commit push times. Each entry uses // roughly 100 bytes of memory. PushedAtSize int `yaml:"pushed_at_size"` + + // The size of the global cache for parsed CODEOWNERS content. This caches + // the parsed CODEOWNERS file for a repository at a given base branch commit + // to avoid repeated HTTP requests. + CodeownersSize int `yaml:"codeowners_size"` + + // The size of the global cache for team membership checks. Each entry + // caches the result of a team membership API call with a 5 minute TTL. + MembershipSize int `yaml:"membership_size"` + + // The size of the global cache for team member lists. Each entry caches + // the full list of team members with metadata (avatars, URLs) with a 5 minute TTL. + TeamsSize int `yaml:"teams_size"` } type WorkerConfig struct { diff --git a/server/handler/base.go b/server/handler/base.go index b1bad1fb9..c8e0e8de0 100644 --- a/server/handler/base.go +++ b/server/handler/base.go @@ -17,7 +17,7 @@ package handler import ( "context" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-baseapp/baseapp" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" @@ -69,7 +69,7 @@ func (b *Base) NewEvalContext(ctx context.Context, installationID int64, loc pul return nil, err } - mbrCtx := NewCrossOrgMembershipContext(ctx, client, loc.Owner, b.Installations, b.ClientCreator) + mbrCtx := NewCrossOrgMembershipContext(ctx, client, loc.Owner, b.Installations, b.ClientCreator, b.GlobalCache) prctx, err := pull.NewGitHubContext(ctx, mbrCtx, b.GlobalCache, client, v4client, loc) if err != nil { return nil, err diff --git a/server/handler/check_run.go b/server/handler/check_run.go index a65ef2a1c..2c97255e1 100644 --- a/server/handler/check_run.go +++ b/server/handler/check_run.go @@ -18,7 +18,7 @@ import ( "context" "encoding/json" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/cross_org.go b/server/handler/cross_org.go index 798999498..e8ea3cd26 100644 --- a/server/handler/cross_org.go +++ b/server/handler/cross_org.go @@ -17,8 +17,9 @@ package handler import ( "context" "strings" + "sync" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/pull" "github.com/pkg/errors" @@ -29,50 +30,65 @@ type CrossOrgMembershipContext struct { lookupClient *github.Client installations githubapp.InstallationsService clientCreator githubapp.ClientCreator + globalCache pull.GlobalCache - mbrCtxs map[string]pull.MembershipContext + mbrCtxs sync.Map // map[string]pull.MembershipContext } -func NewCrossOrgMembershipContext(ctx context.Context, client *github.Client, orgName string, installations githubapp.InstallationsService, clientCreator githubapp.ClientCreator) *CrossOrgMembershipContext { +func NewCrossOrgMembershipContext(ctx context.Context, client *github.Client, orgName string, installations githubapp.InstallationsService, clientCreator githubapp.ClientCreator, globalCache pull.GlobalCache) *CrossOrgMembershipContext { mbrCtx := &CrossOrgMembershipContext{ ctx: ctx, lookupClient: client, installations: installations, clientCreator: clientCreator, - mbrCtxs: make(map[string]pull.MembershipContext), + globalCache: globalCache, } - mbrCtx.mbrCtxs[orgName] = pull.NewGitHubMembershipContext(ctx, client) + mbrCtx.mbrCtxs.Store(orgName, pull.NewGitHubMembershipContext(ctx, client, globalCache)) return mbrCtx } +func (c *CrossOrgMembershipContext) getCtxForTeam(team string) (pull.MembershipContext, error) { + return c.getCtxForOrg(strings.Split(team, "/")[0]) +} + func (c *CrossOrgMembershipContext) getCtxForOrg(name string) (pull.MembershipContext, error) { - mbrCtx, ok := c.mbrCtxs[name] - if !ok { - org, _, err := c.lookupClient.Organizations.Get(c.ctx, name) - if err != nil { - return nil, errors.WithStack(err) - } - - installation, err := c.installations.GetByOwner(c.ctx, org.GetLogin()) - if err != nil { - return nil, errors.Wrapf(err, "failed to lookup installation ID for org '%s' or there is no such installation", name) - } - - client, err := c.clientCreator.NewInstallationClient(installation.ID) - if err != nil { - return nil, err - } - - mbrCtx = pull.NewGitHubMembershipContext(c.ctx, client) - c.mbrCtxs[name] = mbrCtx + if val, ok := c.mbrCtxs.Load(name); ok { + return val.(pull.MembershipContext), nil + } + + // Create a new membership context for this org + mbrCtx, err := c.createMembershipContext(name) + if err != nil { + return nil, err + } + + // Use LoadOrStore to handle concurrent creation - if another goroutine + // already stored a context, use that one instead + actual, _ := c.mbrCtxs.LoadOrStore(name, mbrCtx) + return actual.(pull.MembershipContext), nil +} + +func (c *CrossOrgMembershipContext) createMembershipContext(name string) (pull.MembershipContext, error) { + org, _, err := c.lookupClient.Organizations.Get(c.ctx, name) + if err != nil { + return nil, errors.WithStack(err) + } + + installation, err := c.installations.GetByOwner(c.ctx, org.GetLogin()) + if err != nil { + return nil, errors.Wrapf(err, "failed to lookup installation ID for org '%s' or there is no such installation", name) + } + + client, err := c.clientCreator.NewInstallationClient(installation.ID) + if err != nil { + return nil, err } - return mbrCtx, nil + return pull.NewGitHubMembershipContext(c.ctx, client, c.globalCache), nil } func (c *CrossOrgMembershipContext) IsTeamMember(team, user string) (bool, error) { - org := strings.Split(team, "/")[0] - mbrCtx, err := c.getCtxForOrg(org) + mbrCtx, err := c.getCtxForTeam(team) if err != nil { return false, err } @@ -96,10 +112,25 @@ func (c *CrossOrgMembershipContext) OrganizationMembers(org string) ([]string, e } func (c *CrossOrgMembershipContext) TeamMembers(team string) ([]string, error) { - org := strings.Split(team, "/")[0] - mbrCtx, err := c.getCtxForOrg(org) + mbrCtx, err := c.getCtxForTeam(team) if err != nil { return nil, err } return mbrCtx.TeamMembers(team) } + +func (c *CrossOrgMembershipContext) TeamMembersWithDetails(team string) ([]pull.TeamMember, error) { + mbrCtx, err := c.getCtxForTeam(team) + if err != nil { + return nil, err + } + return mbrCtx.TeamMembersWithDetails(team) +} + +func (c *CrossOrgMembershipContext) TeamInfo(team string) (*pull.TeamInfo, error) { + mbrCtx, err := c.getCtxForTeam(team) + if err != nil { + return nil, err + } + return mbrCtx.TeamInfo(team) +} diff --git a/server/handler/details.go b/server/handler/details.go index 9cca4e231..6990b1174 100644 --- a/server/handler/details.go +++ b/server/handler/details.go @@ -27,7 +27,7 @@ import ( "github.com/alexedwards/scs" "github.com/bluekeyes/hatpear" "github.com/bluekeyes/templatetree" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" @@ -74,6 +74,8 @@ func (h *Details) ServeHTTP(w http.ResponseWriter, r *http.Request) error { PullRequest *github.PullRequest Result *common.Result + Codeowners *pull.CodeownersResult + PullContext pull.Context } data.BasePath = getBasePath(h.BaseConfig.PublicURL) @@ -81,6 +83,7 @@ func (h *Details) ServeHTTP(w http.ResponseWriter, r *http.Request) error { data.PolicyURL = getPolicyURL(state.PullRequest, evalCtx.Config) data.ExpandRequiredReviewers = h.PullOpts.ExpandRequiredReviewers data.PullRequest = state.PullRequest + data.PullContext = evalCtx.PullContext evaluator, err := evalCtx.ParseConfig(ctx, common.TriggerAll) if err != nil { @@ -102,6 +105,11 @@ func (h *Details) ServeHTTP(w http.ResponseWriter, r *http.Request) error { data.Error = err } + // Fetch codeowners data for display in the UI + if evalCtx.PullContext != nil { + data.Codeowners, _ = evalCtx.PullContext.Codeowners() + } + // Intentionally skip evalCtx.RunPostEvaluateActions() for details // evaluations to minimize side-effects when viewing policy status. These // actions are best-effort, so if they were missed by normal event diff --git a/server/handler/details_reviewers.go b/server/handler/details_reviewers.go index b840bcc56..c0042e624 100644 --- a/server/handler/details_reviewers.go +++ b/server/handler/details_reviewers.go @@ -17,8 +17,9 @@ package handler import ( "net/http" "slices" + "strings" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/policy-bot/policy" "github.com/palantir/policy-bot/policy/approval" "github.com/palantir/policy-bot/pull" @@ -29,13 +30,96 @@ type DetailsReviewers struct { Details } +type ReviewerInfo struct { + Name string // Username/login + Username string // Secondary identifier (usually same as Name) + Link string + AvatarURL string +} + +type ReviewerGroup struct { + Name string // Group display name (team slug, org name, or "Other") + Reviewers []ReviewerInfo // Reviewers in this group +} + type DetailsReviewersData struct { PullRequest *github.PullRequest - Reviewers []string + Groups []ReviewerGroup Incomplete bool } +// reviewerCollector collects reviewers grouped by source. +type reviewerCollector struct { + groups map[string]*reviewerGroupData + seen map[string]struct{} // track all seen usernames to avoid duplicates +} + +type reviewerGroupData struct { + label string + reviewers []ReviewerInfo +} + +func newReviewerCollector() *reviewerCollector { + return &reviewerCollector{ + groups: make(map[string]*reviewerGroupData), + seen: make(map[string]struct{}), + } +} + +func (c *reviewerCollector) add(groupKey, groupLabel, name, link, avatarURL string) { + if _, ok := c.seen[name]; ok { + return + } + c.seen[name] = struct{}{} + + group := c.groups[groupKey] + if group == nil { + group = &reviewerGroupData{label: groupLabel} + c.groups[groupKey] = group + } + + group.reviewers = append(group.reviewers, ReviewerInfo{ + Name: name, + Username: name, + Link: link, + AvatarURL: avatarURL, + }) +} + +func (c *reviewerCollector) toGroups() []ReviewerGroup { + // Collect and sort group keys by label, then key for stability. + groupKeys := make([]string, 0, len(c.groups)) + for key := range c.groups { + groupKeys = append(groupKeys, key) + } + slices.SortFunc(groupKeys, func(a, b string) int { + if c.groups[a].label == c.groups[b].label { + return strings.Compare(a, b) + } + return strings.Compare(c.groups[a].label, c.groups[b].label) + }) + + // Build sorted groups + result := make([]ReviewerGroup, 0, len(c.groups)) + for _, groupKey := range groupKeys { + group := c.groups[groupKey] + reviewers := group.reviewers + slices.SortFunc(reviewers, func(a, b ReviewerInfo) int { + return strings.Compare(a.Name, b.Name) + }) + result = append(result, ReviewerGroup{ + Name: group.label, + Reviewers: reviewers, + }) + } + return result +} + func (h *DetailsReviewers) ServeHTTP(w http.ResponseWriter, r *http.Request) error { + if !h.PullOpts.ExpandRequiredReviewers { + return h.renderEmptyReviewers(w, r, nil) + } + state := h.getStateIfAllowed(w, r) if state == nil { return nil @@ -49,17 +133,14 @@ func (h *DetailsReviewers) ServeHTTP(w http.ResponseWriter, r *http.Request) err switch { case config.LoadError != nil: logger.Warn().Err(config.LoadError).Msgf("Error loading policy from %s, reviewers will be incomplete", config.Source) - return h.renderReviewers(w, r, DetailsReviewersData{ - PullRequest: state.PullRequest, - Incomplete: true, - }) + return h.renderReviewers(w, r, DetailsReviewersData{PullRequest: state.PullRequest, Incomplete: true}) case config.Config == nil: // The repository either has no policy or the policy was invalid. This // should never happen in normal use, because the expected way to hit // this endpoint requires viewing a valid details page first. Hitting // this case means something unexpected is hitting the API directly. - return h.renderReviewers(w, r, DetailsReviewersData{PullRequest: state.PullRequest}) + return h.renderEmptyReviewers(w, r, state.PullRequest) } ruleName := r.URL.Query().Get("rule") @@ -68,14 +149,18 @@ func (h *DetailsReviewers) ServeHTTP(w http.ResponseWriter, r *http.Request) err if requires == nil || requires.Count == 0 || requires.Actors.IsZero() { // If the rule does not exist, it does not require approval, or it has // no actors specified, there's no need to list reviewers - return h.renderReviewers(w, r, DetailsReviewersData{PullRequest: state.PullRequest}) + return h.renderEmptyReviewers(w, r, state.PullRequest) } - var reviewers []string - var incomplete bool + collector := newReviewerCollector() + incomplete := false - // Add direct users - reviewers = append(reviewers, requires.Actors.Users...) + githubURL := defaultGitHubURL(evalctx.PublicURL) + + // Add direct users (group: "Users") + for _, user := range requires.Actors.Users { + collector.add("Users", "Users", user, githubURL+"/"+user, "") + } // Add organization members for _, org := range requires.Actors.Organizations { @@ -84,18 +169,23 @@ func (h *DetailsReviewers) ServeHTTP(w http.ResponseWriter, r *http.Request) err logger.Warn().Err(err).Str("organization", org).Msg("Error listing organization members, reviewers will be incomplete") incomplete = true } else { - reviewers = append(reviewers, members...) + for _, m := range members { + collector.add(org, org, m, githubURL+"/"+m, "") + } } } - // Add team members + // Add team members with details (avatars, display names) for _, team := range requires.Actors.Teams { - members, err := prctx.TeamMembers(team) + groupKey, groupLabel := teamGroupKeyLabel(team) + members, err := prctx.TeamMembersWithDetails(team) if err != nil { logger.Warn().Err(err).Str("team", team).Msg("Error listing team members, reviewers will be incomplete") incomplete = true } else { - reviewers = append(reviewers, members...) + for _, m := range members { + collector.add(groupKey, groupLabel, m.Login, m.HTMLURL, m.AvatarURL) + } } } @@ -109,23 +199,51 @@ func (h *DetailsReviewers) ServeHTTP(w http.ResponseWriter, r *http.Request) err } else { for _, user := range userCollaborators { if userHasReviewerPermission(user, perms) { - reviewers = append(reviewers, user.Name) + collector.add("Collaborators", "Collaborators", user.Name, githubURL+"/"+user.Name, "") } } } } - // Order the reviewers and remove any duplicates - slices.Sort(reviewers) - reviewers = slices.Compact(reviewers) + // Add codeowners (both direct users and team members) + if requires.Actors.Codeowners { + co, err := prctx.Codeowners() + if err != nil { + logger.Warn().Err(err).Msg("Error loading codeowners, reviewers will be incomplete") + incomplete = true + } else if co != nil { + for _, owner := range co.AllOwners() { + ownerType, name := pull.ParseCodeowner(owner) + switch ownerType { + case "user": + collector.add("Codeowners", "Codeowners", name, githubURL+"/"+name, "") + case "team": + groupKey, groupLabel := teamGroupKeyLabel(name) + members, err := prctx.TeamMembersWithDetails(name) + if err != nil { + logger.Warn().Err(err).Str("team", name).Msg("Error listing codeowner team members, reviewers will be incomplete") + incomplete = true + } else { + for _, m := range members { + collector.add(groupKey, groupLabel, m.Login, m.HTMLURL, m.AvatarURL) + } + } + } + } + } + } return h.renderReviewers(w, r, DetailsReviewersData{ PullRequest: state.PullRequest, - Reviewers: reviewers, + Groups: collector.toGroups(), Incomplete: incomplete, }) } +func (h *DetailsReviewers) renderEmptyReviewers(w http.ResponseWriter, r *http.Request, pr *github.PullRequest) error { + return h.renderReviewers(w, r, DetailsReviewersData{PullRequest: pr}) +} + func (h *DetailsReviewers) renderReviewers(w http.ResponseWriter, r *http.Request, data DetailsReviewersData) error { tmpl, ok := h.Templates["details_reviewers.html.tmpl"] if !ok { @@ -158,3 +276,19 @@ func findRuleRequires(config *policy.Config, ruleName string) *approval.Requires } return nil } + +func defaultGitHubURL(publicURL string) string { + if publicURL == "" { + return "https://github.com" + } + return publicURL +} + +// teamGroupKeyLabel returns the key (full team name) and label (team slug only) +// for grouping reviewers by team. For "org/team-slug", returns ("org/team-slug", "team-slug"). +func teamGroupKeyLabel(team string) (key, label string) { + if idx := strings.LastIndex(team, "/"); idx != -1 { + return team, team[idx+1:] + } + return team, team +} diff --git a/server/handler/eval_context.go b/server/handler/eval_context.go index 708b06e17..feeebecc0 100644 --- a/server/handler/eval_context.go +++ b/server/handler/eval_context.go @@ -19,7 +19,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/policy-bot/policy" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" @@ -78,9 +78,13 @@ func (ec *EvalContext) ParseConfig(ctx context.Context, trigger common.Trigger) switch { case fc.LoadError != nil: msg := fmt.Sprintf("Error loading policy from %s", fc.Source) - logger.Warn().Err(fc.LoadError).Msg(msg) + logger.Warn().Err(fc.LoadError).Bool("seen_policy", fc.SeenPolicy).Msg(msg) - ec.PostStatus(ctx, "error", msg) + // If policy-bot has never seen a policy file for this base branch + // then suppress the failing status. + if fc.SeenPolicy { + ec.PostStatus(ctx, "error", msg) + } return nil, errors.Wrapf(fc.LoadError, "failed to load policy: %s: %s", fc.Source, fc.Path) case fc.ParseError != nil: @@ -145,7 +149,7 @@ func (ec *EvalContext) EvaluatePolicy(ctx context.Context, evaluator common.Eval case common.StatusDisapproved: statusState = "failure" case common.StatusPending: - statusState = "pending" + statusState = "failure" case common.StatusSkipped: statusState = "error" statusDescription = "All rules were skipped. At least one rule must match." @@ -183,14 +187,13 @@ func (ec *EvalContext) PostStatus(ctx context.Context, state, message string) { owner := ec.PullContext.RepositoryOwner() repo := ec.PullContext.RepositoryName() sha := ec.PullContext.HeadSHA() - base, _ := ec.PullContext.Branches() publicURL := strings.TrimSuffix(ec.PublicURL, "/") detailsURL := fmt.Sprintf("%s/details/%s/%s/%d", publicURL, owner, repo, ec.PullContext.Number()) status := github.RepoStatus{ State: &state, - Context: new(fmt.Sprintf("%s: %s", ec.Options.StatusCheckContext, base)), + Context: github.Ptr(fmt.Sprintf("%s", ec.Options.StatusCheckContext)), Description: &message, TargetURL: &detailsURL, } diff --git a/server/handler/eval_context_dismissal.go b/server/handler/eval_context_dismissal.go index 1e3cd3808..d4dbb90ab 100644 --- a/server/handler/eval_context_dismissal.go +++ b/server/handler/eval_context_dismissal.go @@ -36,7 +36,7 @@ func (ec *EvalContext) dismissStaleReviewsForResult(ctx context.Context, result } if !ec.Options.StrictReviewDismissal { // Only dismiss reviews from users who are not currently approvers - if approvers[d.Candidate.User] { + if approvers[d.Candidate.User()] { continue } } @@ -73,7 +73,7 @@ func findAllApprovers(result *common.Result) map[string]bool { if len(result.Children) == 0 && result.Error == nil { for _, a := range result.Requires.Approvers { - approvers[a.User] = true + approvers[a.User()] = true } } for _, c := range result.Children { diff --git a/server/handler/eval_context_reviewers.go b/server/handler/eval_context_reviewers.go index b95e7e276..b20a390c7 100644 --- a/server/handler/eval_context_reviewers.go +++ b/server/handler/eval_context_reviewers.go @@ -20,7 +20,7 @@ import ( "slices" "time" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/policy/reviewer" "github.com/palantir/policy-bot/pull" @@ -104,10 +104,12 @@ func (ec *EvalContext) requestReviews(ctx context.Context, reqs []*common.Result } for _, r := range reviews { if r.SHA == head { - reviewers = append(reviewers, &pull.Reviewer{ - Type: pull.ReviewerUser, - Name: r.Author, - }) + if r.Author != nil && r.Author.Login != "" { + reviewers = append(reviewers, &pull.Reviewer{ + Type: pull.ReviewerUser, + Name: r.Author.Login, + }) + } for _, team := range r.Teams { reviewers = append(reviewers, &pull.Reviewer{ diff --git a/server/handler/eval_context_test.go b/server/handler/eval_context_test.go new file mode 100644 index 000000000..162d1c759 --- /dev/null +++ b/server/handler/eval_context_test.go @@ -0,0 +1,72 @@ +// Copyright 2026 Palantir Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package handler + +import ( + "context" + "errors" + "testing" + + "github.com/palantir/policy-bot/policy/common" + "github.com/palantir/policy-bot/pull/pulltest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestParseConfigSuppressesStatusForUnseenPolicy(t *testing.T) { + ec := makeEvalContext(false) + + evaluator, err := ec.ParseConfig(context.Background(), common.TriggerAll) + require.Error(t, err) + assert.Nil(t, evaluator) + assert.Nil(t, ec.Status) +} + +func TestParseConfigPostsStatusForSeenPolicy(t *testing.T) { + ec := makeEvalContext(true) + + evaluator, err := ec.ParseConfig(context.Background(), common.TriggerAll) + require.Error(t, err) + assert.Nil(t, evaluator) + require.NotNil(t, ec.Status) + assert.Equal(t, "error", ec.Status.GetState()) + assert.Equal(t, "policy-bot: main", ec.Status.GetContext()) + assert.Equal(t, "Error loading policy from testorg/testrepo@main", ec.Status.GetDescription()) +} + +func makeEvalContext(seenPolicy bool) *EvalContext { + return &EvalContext{ + Options: &PullEvaluationOptions{ + StatusCheckContext: "policy-bot", + }, + PublicURL: "https://policy-bot.example.com", + PullContext: &pulltest.Context{ + OwnerValue: "testorg", + RepoValue: "testrepo", + NumberValue: 42, + StateValue: "open", + HeadSHAValue: "abc123", + BranchBaseName: "main", + BranchHeadName: "feature", + }, + SkipPostStatus: true, + Config: FetchedConfig{ + LoadError: errors.New("request failed"), + Source: "testorg/testrepo@main", + Path: ".policy.yml", + SeenPolicy: seenPolicy, + }, + } +} diff --git a/server/handler/fetcher.go b/server/handler/fetcher.go index 77dfed164..c00aab654 100644 --- a/server/handler/fetcher.go +++ b/server/handler/fetcher.go @@ -21,12 +21,17 @@ import ( "os" "time" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/appconfig" "github.com/palantir/policy-bot/policy" "gopkg.in/yaml.v2" ) +// ConfigLoader allows ConfigFetcher to unit test policy loading decisions +type ConfigLoader interface { + LoadConfig(ctx context.Context, client *github.Client, owner, repo, ref string) (appconfig.Config, error) +} + type FetchedConfig struct { Config *policy.Config LoadError error @@ -34,13 +39,22 @@ type FetchedConfig struct { Source string Path string + + SeenPolicy bool } type ConfigFetcher struct { - Loader *appconfig.Loader + Loader ConfigLoader + SeenPolicyCache *SeenPolicyCache } func (cf *ConfigFetcher) ConfigForRepositoryBranch(ctx context.Context, client *github.Client, owner, repository, branch string) FetchedConfig { + key := SeenPolicyKey{ + Owner: owner, + Repository: repository, + BaseBranch: branch, + } + retries := 0 delay := 1 * time.Second for { @@ -51,6 +65,7 @@ func (cf *ConfigFetcher) ConfigForRepositoryBranch(ctx context.Context, client * } if err != nil { + fc.SeenPolicy = cf.SeenPolicyCache.Get(key) if !os.IsTimeout(err) && !isServerError(err) { fc.LoadError = err return fc @@ -76,6 +91,10 @@ func (cf *ConfigFetcher) ConfigForRepositoryBranch(ctx context.Context, client * return fc } + cf.SeenPolicyCache.Set(key) + // Mark the branch as having seen a policy even if parsing fails below. + fc.SeenPolicy = true + var pc policy.Config if err := yaml.UnmarshalStrict(c.Content, &pc); err != nil { fc.ParseError = err diff --git a/server/handler/fetcher_test.go b/server/handler/fetcher_test.go new file mode 100644 index 000000000..47e548fb3 --- /dev/null +++ b/server/handler/fetcher_test.go @@ -0,0 +1,114 @@ +// Copyright 2026 Palantir Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package handler + +import ( + "context" + "errors" + "testing" + + "github.com/google/go-github/v85/github" + "github.com/palantir/go-githubapp/appconfig" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +type mockConfigLoader struct { + loadConfig func(ctx context.Context, client *github.Client, owner, repo, ref string) (appconfig.Config, error) +} + +func (s mockConfigLoader) LoadConfig(ctx context.Context, client *github.Client, owner, repo, ref string) (appconfig.Config, error) { + return s.loadConfig(ctx, client, owner, repo, ref) +} + +func TestConfigFetcherMarksSeenPolicy(t *testing.T) { + cache := NewSeenPolicyCache() + + fetcher := ConfigFetcher{ + Loader: mockConfigLoader{ + loadConfig: func(ctx context.Context, client *github.Client, owner, repo, ref string) (appconfig.Config, error) { + return appconfig.Config{ + Content: []byte("policy: ["), + Source: "testorg/testrepo@main", + Path: ".policy.yml", + }, nil + }, + }, + SeenPolicyCache: cache, + } + + fc := fetcher.ConfigForRepositoryBranch(context.Background(), nil, "testorg", "testrepo", "main") + require.Error(t, fc.ParseError) + assert.True(t, fc.SeenPolicy) + + ok := cache.Get(SeenPolicyKey{ + Owner: "testorg", + Repository: "testrepo", + BaseBranch: "main", + }) + require.True(t, ok) +} + +func TestConfigFetcherChecksSeenPolicyOnLoadError(t *testing.T) { + cache := NewSeenPolicyCache() + cache.Set(SeenPolicyKey{ + Owner: "testorg", + Repository: "testrepo", + BaseBranch: "main", + }) + + fetcher := ConfigFetcher{ + Loader: mockConfigLoader{ + loadConfig: func(ctx context.Context, client *github.Client, owner, repo, ref string) (appconfig.Config, error) { + return appconfig.Config{ + Source: "testorg/testrepo@main", + Path: ".policy.yml", + }, errors.New("request failed") + }, + }, + SeenPolicyCache: cache, + } + + fc := fetcher.ConfigForRepositoryBranch(context.Background(), nil, "testorg", "testrepo", "main") + require.Error(t, fc.LoadError) + assert.True(t, fc.SeenPolicy) +} + +func TestConfigFetcherScopesSeenPolicyByBranch(t *testing.T) { + const releaseBranch = "release" + + cache := NewSeenPolicyCache() + cache.Set(SeenPolicyKey{ + Owner: "testorg", + Repository: "testrepo", + BaseBranch: "main", + }) + + fetcher := ConfigFetcher{ + Loader: mockConfigLoader{ + loadConfig: func(ctx context.Context, client *github.Client, owner, repo, ref string) (appconfig.Config, error) { + return appconfig.Config{ + Source: "testorg/testrepo@" + releaseBranch, + Path: ".policy.yml", + }, errors.New("request failed") + }, + }, + SeenPolicyCache: cache, + } + + fc := fetcher.ConfigForRepositoryBranch(context.Background(), nil, "testorg", "testrepo", releaseBranch) + require.Error(t, fc.LoadError) + assert.False(t, fc.SeenPolicy) +} diff --git a/server/handler/frontend.go b/server/handler/frontend.go index 00e6709c7..8951bef52 100644 --- a/server/handler/frontend.go +++ b/server/handler/frontend.go @@ -29,6 +29,7 @@ import ( "github.com/bluekeyes/templatetree" "github.com/palantir/policy-bot/policy/common" + "github.com/palantir/policy-bot/pull" "github.com/pkg/errors" ) @@ -45,8 +46,10 @@ type FilesConfig struct { } type Membership struct { - Name string - Link string + Name string // Secondary identifier or last-resort label + Username string // Preferred visible label (e.g., "org/team-slug" or "username") + Link string + AvatarURL string } func LoadTemplates(c *FilesConfig, basePath string, githubURL string) (templatetree.Tree[*template.Template], error) { @@ -108,7 +111,38 @@ func LoadTemplates(c *FilesConfig, basePath string, githubURL string) (templatet return r }, "hasActors": func(requires common.RequiresResult) bool { - return len(requires.Actors.Users) > 0 || len(requires.Actors.Teams) > 0 || len(requires.Actors.Organizations) > 0 + return len(requires.Actors.Users) > 0 || + len(requires.Actors.Teams) > 0 || + len(requires.Actors.Organizations) > 0 || + requires.Actors.Codeowners + }, + "hasCodeowners": func(requires common.RequiresResult) bool { + return requires.Actors.Codeowners + }, + "hasOwnershipGroups": func(requires common.RequiresResult) bool { + return len(requires.OwnershipGroups) > 0 + }, + "getOwnershipGroups": func(requires common.RequiresResult) []common.OwnershipGroupResult { + return requires.OwnershipGroups + }, + "getEnrichedOwnershipGroups": func(prctx pull.Context, requires common.RequiresResult) []EnrichedOwnershipGroup { + return getEnrichedOwnershipGroups(prctx, requires, githubURL) + }, + "getCodeownersBreakdown": func(co *pull.CodeownersResult) map[string][]string { + if co == nil { + return nil + } + return co.OwnersByOwner() + }, + "codeownerLink": func(owner string) string { + ownerType, name := pull.ParseCodeowner(owner) + if ownerType == "team" { + parts := strings.SplitN(name, "/", 2) + if len(parts) == 2 { + return githubURL + "/orgs/" + parts[0] + "/teams/" + parts[1] + } + } + return githubURL + "/" + name }, "getMethods": func(results *common.Result) map[string][]string { return getMethods(results) @@ -209,15 +243,15 @@ func getActors(result *common.Result, githubURL string) map[string][]Membership membershipInfo := make(map[string][]Membership) for _, org := range result.Requires.Actors.Organizations { - membershipInfo[orgKey] = append(membershipInfo[orgKey], Membership{Name: org, Link: githubURL + "/orgs/" + org + "/people"}) + membershipInfo[orgKey] = append(membershipInfo[orgKey], Membership{Name: org, Username: org, Link: githubURL + "/orgs/" + org + "/people"}) } for _, team := range result.Requires.Actors.Teams { teamName := strings.Split(team, "/") - membershipInfo[teamKey] = append(membershipInfo[teamKey], Membership{Name: team, Link: githubURL + "/orgs/" + teamName[0] + "/teams/" + teamName[1] + "/members"}) + membershipInfo[teamKey] = append(membershipInfo[teamKey], Membership{Name: team, Username: team, Link: githubURL + "/orgs/" + teamName[0] + "/teams/" + teamName[1] + "/members"}) } for _, user := range result.Requires.Actors.Users { - membershipInfo[userKey] = append(membershipInfo[userKey], Membership{Name: user, Link: githubURL + "/" + user}) + membershipInfo[userKey] = append(membershipInfo[userKey], Membership{Name: user, Username: user, Link: githubURL + "/" + user}) } return membershipInfo } @@ -230,3 +264,95 @@ func getPermissions(result *common.Result) []string { } return permStrings } + +// EnrichedOwnershipGroup contains enriched ownership group data for display. +type EnrichedOwnershipGroup struct { + Key string + Files []string + Satisfied bool + Owners []Membership + Approvers []Membership +} + +func getEnrichedOwnershipGroups(prctx pull.Context, requires common.RequiresResult, githubURL string) []EnrichedOwnershipGroup { + approversByLogin := buildApproversMap(requires.Approvers) + teamInfoCache := make(map[string]*pull.TeamInfo) + + result := make([]EnrichedOwnershipGroup, 0, len(requires.OwnershipGroups)) + for _, group := range requires.OwnershipGroups { + enriched := EnrichedOwnershipGroup{ + Key: group.Key, + Files: group.Files, + Satisfied: group.Satisfied, + Owners: enrichOwners(group.Owners, githubURL, prctx, teamInfoCache), + Approvers: enrichApprovers(group.Approvers, approversByLogin, githubURL), + } + result = append(result, enriched) + } + + return result +} + +func buildApproversMap(approvers []*common.Candidate) map[string]*common.Candidate { + m := make(map[string]*common.Candidate, len(approvers)) + for _, c := range approvers { + m[c.User()] = c + } + return m +} + +func enrichOwners(owners []string, githubURL string, prctx pull.Context, teamInfoCache map[string]*pull.TeamInfo) []Membership { + result := make([]Membership, 0, len(owners)) + for _, owner := range owners { + ownerType, name := pull.ParseCodeowner(owner) + m := Membership{Name: name, Username: name} + + switch ownerType { + case "team": + parts := strings.Split(name, "/") + if len(parts) == 2 { + org, team := parts[0], parts[1] + m.Link = githubURL + "/orgs/" + org + "/teams/" + team + if prctx != nil { + info, ok := teamInfoCache[name] + if !ok { + info, _ = prctx.TeamInfo(name) + teamInfoCache[name] = info + } + if info != nil && info.ID != 0 { + m.AvatarURL = teamAvatarURL(info.ID) + } + } + if m.AvatarURL == "" { + m.AvatarURL = githubURL + "/" + org + ".png" + } + } + case "user": + m.Link = githubURL + "/" + name + m.AvatarURL = githubURL + "/" + name + ".png" + } + + result = append(result, m) + } + return result +} + +func teamAvatarURL(teamID int64) string { + return fmt.Sprintf("https://avatars.githubusercontent.com/t/%d?s=116&v=4", teamID) +} + +func enrichApprovers(approverNames []string, approversByLogin map[string]*common.Candidate, githubURL string) []Membership { + result := make([]Membership, 0, len(approverNames)) + for _, name := range approverNames { + m := Membership{ + Name: name, + Username: name, + Link: githubURL + "/" + name, + } + if candidate, ok := approversByLogin[name]; ok && candidate.Author != nil { + m.AvatarURL = candidate.Author.AvatarURL + } + result = append(result, m) + } + return result +} diff --git a/server/handler/installation.go b/server/handler/installation.go index 0811694b0..a89048313 100644 --- a/server/handler/installation.go +++ b/server/handler/installation.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/rs/zerolog" @@ -98,7 +98,7 @@ func (h *Installation) postRepoInstallationStatus(ctx context.Context, client *g } head := branch.GetCommit().GetSHA() - contextWithBranch := fmt.Sprintf("%s: %s", h.PullOpts.StatusCheckContext, defaultBranch) + contextWithBranch := fmt.Sprintf("%s", h.PullOpts.StatusCheckContext) state := "success" message := fmt.Sprintf("%s successfully installed.", h.AppName) status := github.RepoStatus{ diff --git a/server/handler/issue_comment.go b/server/handler/issue_comment.go index 15f587ce1..9df73bc48 100644 --- a/server/handler/issue_comment.go +++ b/server/handler/issue_comment.go @@ -19,7 +19,7 @@ import ( "encoding/json" "fmt" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy" "github.com/palantir/policy-bot/policy/common" diff --git a/server/handler/login.go b/server/handler/login.go index 4651e105c..9a9e78b76 100644 --- a/server/handler/login.go +++ b/server/handler/login.go @@ -21,7 +21,7 @@ import ( "github.com/alexedwards/scs" "github.com/bluekeyes/hatpear" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/go-githubapp/oauth2" "github.com/pkg/errors" diff --git a/server/handler/merge_group.go b/server/handler/merge_group.go index c87c3924f..2965ad79d 100644 --- a/server/handler/merge_group.go +++ b/server/handler/merge_group.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/rs/zerolog" @@ -65,7 +65,7 @@ func (h *MergeGroup) Handle(ctx context.Context, eventType, devlieryID string, p return nil } - contextWithBranch := fmt.Sprintf("%s: %s", h.PullOpts.StatusCheckContext, baseBranch) + contextWithBranch := fmt.Sprintf("%s", h.PullOpts.StatusCheckContext) state := "success" message := fmt.Sprintf("%s previously approved original pull request.", h.AppName) status := github.RepoStatus{ diff --git a/server/handler/pull_request.go b/server/handler/pull_request.go index 3b80287f5..034c608d5 100644 --- a/server/handler/pull_request.go +++ b/server/handler/pull_request.go @@ -18,7 +18,7 @@ import ( "context" "encoding/json" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/pull_request_review.go b/server/handler/pull_request_review.go index 979f016df..4b53bc1cc 100644 --- a/server/handler/pull_request_review.go +++ b/server/handler/pull_request_review.go @@ -18,7 +18,7 @@ import ( "context" "encoding/json" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy" "github.com/palantir/policy-bot/policy/common" diff --git a/server/handler/seen_policy_cache.go b/server/handler/seen_policy_cache.go new file mode 100644 index 000000000..197c5b8c1 --- /dev/null +++ b/server/handler/seen_policy_cache.go @@ -0,0 +1,58 @@ +// Copyright 2026 Palantir Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package handler + +import ( + "sync" +) + +// SeenPolicyKey identifies a repo branch where policy-bot has seen a policy file. +type SeenPolicyKey struct { + Owner string + Repository string + BaseBranch string +} + +type SeenPolicyCache struct { + mu sync.RWMutex + entries map[SeenPolicyKey]struct{} +} + +func NewSeenPolicyCache() *SeenPolicyCache { + return &SeenPolicyCache{ + entries: make(map[SeenPolicyKey]struct{}), + } +} + +func (c *SeenPolicyCache) Get(key SeenPolicyKey) bool { + if c == nil { + return false + } + + c.mu.RLock() + _, ok := c.entries[key] + c.mu.RUnlock() + return ok +} + +func (c *SeenPolicyCache) Set(key SeenPolicyKey) { + if c == nil { + return + } + + c.mu.Lock() + c.entries[key] = struct{}{} + c.mu.Unlock() +} diff --git a/server/handler/simulate.go b/server/handler/simulate.go index 2e4ba15a7..ed6f3cd49 100644 --- a/server/handler/simulate.go +++ b/server/handler/simulate.go @@ -150,7 +150,7 @@ func (h *Simulate) newSimulatedContext(ctx context.Context, installationID int64 return nil, nil, err } - mbrCtx := NewCrossOrgMembershipContext(ctx, client, loc.Owner, h.Installations, h.ClientCreator) + mbrCtx := NewCrossOrgMembershipContext(ctx, client, loc.Owner, h.Installations, h.ClientCreator, h.GlobalCache) prctx, err := pull.NewGitHubContext(ctx, mbrCtx, h.GlobalCache, client, v4client, loc) if err != nil { return nil, nil, err diff --git a/server/handler/status.go b/server/handler/status.go index f1d0cc150..d7d70b90e 100644 --- a/server/handler/status.go +++ b/server/handler/status.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/workflow_run.go b/server/handler/workflow_run.go index 41b947b15..3e6eeb211 100644 --- a/server/handler/workflow_run.go +++ b/server/handler/workflow_run.go @@ -18,7 +18,7 @@ import ( "context" "encoding/json" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/server.go b/server/server.go index 1fab1f1c8..aea440366 100644 --- a/server/server.go +++ b/server/server.go @@ -48,8 +48,11 @@ const ( DefaultWebhookWorkers = 10 DefaultWebhookQueueSize = 100 - DefaultHTTPCacheSize = 50 * datasize.MB - DefaultPushedAtCacheSize = 100_000 + DefaultHTTPCacheSize = 50 * datasize.MB + DefaultPushedAtCacheSize = 100_000 + DefaultCodeownersCacheSize = 10_000 + DefaultMembershipCacheSize = 10_000 + DefaultTeamsCacheSize = 1_000 ) type Server struct { @@ -138,16 +141,18 @@ func New(c *Config) (*Server, error) { return nil, errors.Wrap(err, "failed to get configured GitHub app") } - pushedAtSize := c.Cache.PushedAtSize - if pushedAtSize == 0 { - pushedAtSize = DefaultPushedAtCacheSize - } + pushedAtSize := cacheSize(c.Cache.PushedAtSize, DefaultPushedAtCacheSize) + codeownersSize := cacheSize(c.Cache.CodeownersSize, DefaultCodeownersCacheSize) + membershipSize := cacheSize(c.Cache.MembershipSize, DefaultMembershipCacheSize) + teamsSize := cacheSize(c.Cache.TeamsSize, DefaultTeamsCacheSize) - globalCache, err := pull.NewLRUGlobalCache(pushedAtSize) + globalCache, err := pull.NewLRUGlobalCache(pushedAtSize, codeownersSize, membershipSize, teamsSize) if err != nil { return nil, errors.Wrap(err, "failed to initialize global cache") } + seenPolicyCache := handler.NewSeenPolicyCache() + policyPaths := []string{c.Options.PolicyPath} if c.Options.ForceSharedPolicy { policyPaths = []string{} @@ -170,6 +175,7 @@ func New(c *Config) (*Server, error) { policyPaths, appconfig.WithOwnerDefault(*c.Options.SharedRepository, sharedPolicyPaths), ), + SeenPolicyCache: seenPolicyCache, }, AppName: app.GetSlug(), @@ -287,3 +293,11 @@ func (s *Server) Start() error { } return s.base.Start() } + +// cacheSize returns the configured size or the default if not set. +func cacheSize(configured, defaultSize int) int { + if configured > 0 { + return configured + } + return defaultSize +} diff --git a/server/templates/details.html.tmpl b/server/templates/details.html.tmpl index d8b07b2f5..5706fe637 100644 --- a/server/templates/details.html.tmpl +++ b/server/templates/details.html.tmpl @@ -67,7 +67,7 @@ {{ $showReviewers := (and $root.ExpandRequiredReviewers (eq $s "pending")) }}
  • - {{template "result-details" .}} + {{template "result-details" (args $root .)}} {{if (or (.PredicateResults) (hasActors .Requires) (hasActorsPermissions .Requires) (gt (len .Requires.Conditions) 0))}}
    - {{template "result-approver-details" .}} + {{template "result-approver-details" (args $root .)}}
    {{template "result-methods-details" .}} @@ -127,6 +127,8 @@ {{end}} {{define "result-details"}} + {{ $root := index . 0 }} + {{with index . 1}} {{ $s := (or (and .Error "error") (.Status | print)) }}

    {{.Name}} @@ -135,7 +137,36 @@ {{if (and .Description (ne $s "skipped"))}}

    {{.Description}}

    {{end}} -

    {{or .Error .StatusDescription}}

    + {{if hasOwnershipGroups .Requires}} + {{template "ownership-groups" (args $root .Requires)}} + {{else}} +

    {{or .Error .StatusDescription}}

    + {{end}} + {{end}} +{{end}} + +{{define "ownership-groups"}} + {{ $root := index . 0 }} + {{with index . 1}} +
    + {{range getEnrichedOwnershipGroups $root.PullContext .}} + {{$status := "pending"}}{{if .Satisfied}}{{$status = "approved"}}{{end}} +
    + + {{with index .Owners 0}} + {{- template "component/actor" . -}} + {{end}} + {{if .Satisfied}} + + ({{range $i, $a := .Approvers}}{{if $i}}, {{end -}} + {{- template "component/actor" $a -}} + {{- end}}) + + {{end}} +
    + {{end}} +
    + {{end}} {{end}} {{define "result-predicates-details"}} @@ -194,8 +225,11 @@ {{end}} {{define "result-approver-details"}} + {{ $root := index . 0 }} + {{with index . 1}} {{$hasActors := hasActors .Requires}} {{$hasPerms := hasActorsPermissions .Requires}} + {{$hasCodeowners := hasCodeowners .Requires}} {{if or $hasActors $hasPerms}} {{template "result-reviews-count" .Requires}} from:
    @@ -207,6 +241,31 @@ {{end}} {{end}} + {{if $hasCodeowners}} +
    Codeowners:
    +
    + {{if $root.Codeowners}} + {{range $owner, $files := getCodeownersBreakdown $root.Codeowners}} +
    + {{$owner}} +
      + {{range $files}}
    • {{.}}
    • {{end}} +
    +
    + {{end}} + {{if $root.Codeowners.HasOrphanFiles}} +
    + No codeowners: +
      + {{range $root.Codeowners.OrphanFiles}}
    • {{.}}
    • {{end}} +
    +
    + {{end}} + {{else}} +

    Unable to load codeowners

    + {{end}} +
    + {{end}} {{if $hasPerms}}
    Users with the permissions:
    @@ -217,6 +276,7 @@ {{else}} {{template "result-reviews-count" .Requires}} {{end}} + {{end}} {{end}} {{define "result-reviews-count"}}This rule requires at least {{.Count}} approval{{if gt .Count 1}}s{{end}}{{end}} diff --git a/server/templates/details_reviewers.html.tmpl b/server/templates/details_reviewers.html.tmpl index c3c2d8126..16f156342 100644 --- a/server/templates/details_reviewers.html.tmpl +++ b/server/templates/details_reviewers.html.tmpl @@ -1,12 +1,21 @@ {{/* templatetree:extends page.html.tmpl */}} -{{define "title"}}{{.PullRequest.GetBase.GetRepo.GetFullName}}#{{.PullRequest.GetNumber}} - Reviewers | PolicyBot{{end}} +{{define "title"}}{{if .PullRequest}}{{.PullRequest.GetBase.GetRepo.GetFullName}}#{{.PullRequest.GetNumber}} - Reviewers | {{end}}PolicyBot{{end}} {{define "body"}} -
      - {{- range .Reviewers}} -
    • {{.}}
    • - {{- else}} -
    • No reviewers found
    • +{{- if .Groups}} + {{- range .Groups}} +
      +
      {{.Name}}:
      +
      + {{- range .Reviewers -}} + {{- template "component/actor" . -}} + {{- end}} +
      +
      {{- end}} -
    -{{if .Incomplete}}

    Due to an error, the reviewer list may be incomplete

    {{end}} +{{- else}} +

    No reviewers found

    +{{- end}} +{{if .Incomplete}} +

    Due to an error, the reviewer list may be incomplete

    +{{end}} {{end}} diff --git a/server/templates/page.html.tmpl b/server/templates/page.html.tmpl index d4fe9e722..d0ab00304 100644 --- a/server/templates/page.html.tmpl +++ b/server/templates/page.html.tmpl @@ -15,3 +15,33 @@ {{block "body" .}}{{end}} + +{{/* + Reusable UI components. + + Note: templatetree parses templates per-file (with inheritance), so shared + components must live in a parent template like this one. +*/}} + +{{/* + component/actor + + Renders either a user or a team identity. Expected fields (all optional except Link/Name): + - AvatarURL string + - Link string + - Username string (preferred visible label; often username/slug) + - Name string (secondary identifier or last-resort label) +*/}} +{{define "component/actor"}} + {{- $display := .Name -}} + {{- if .Username -}} + {{- $display = .Username -}} + {{- end -}} + + + {{- if .AvatarURL -}} + {{$display}} + {{- end -}} + {{$display}} + +{{end}} diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_actions_hosted_runners.go b/vendor/github.com/google/go-github/v82/github/enterprise_actions_hosted_runners.go deleted file mode 100644 index e82ba9b80..000000000 --- a/vendor/github.com/google/go-github/v82/github/enterprise_actions_hosted_runners.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2025 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// ListHostedRunners lists all the GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners -func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - runners := &HostedRunners{} - resp, err := s.client.Do(ctx, req, &runners) - if err != nil { - return nil, resp, err - } - - return runners, resp, nil -} - -// CreateHostedRunner creates a GitHub-hosted runner for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise -// -//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners -func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { - if err := validateCreateHostedRunnerRequest(request); err != nil { - return nil, nil, fmt.Errorf("validation failed: %w", err) - } - - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) - req, err := s.client.NewRequest("POST", u, request) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} - -// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned -func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) - if err != nil { - return nil, resp, err - } - - return hostedRunnerImages, resp, nil -} - -// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner -func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) - if err != nil { - return nil, resp, err - } - - return hostedRunnerImages, resp, nil -} - -// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits -func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - publicIPLimits := new(HostedRunnerPublicIPLimits) - resp, err := s.client.Do(ctx, req, publicIPLimits) - if err != nil { - return nil, resp, err - } - - return publicIPLimits, resp, nil -} - -// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes -func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - machineSpecs := new(HostedRunnerMachineSpecs) - resp, err := s.client.Do(ctx, req, machineSpecs) - if err != nil { - return nil, resp, err - } - - return machineSpecs, resp, nil -} - -// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms -func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - platforms := new(HostedRunnerPlatforms) - resp, err := s.client.Do(ctx, req, platforms) - if err != nil { - return nil, resp, err - } - - return platforms, resp, nil -} - -// GetHostedRunner gets a GitHub-hosted runner in an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} -func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} - -// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise -// -//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} -func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { - if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { - return nil, nil, fmt.Errorf("validation failed: %w", err) - } - - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("PATCH", u, updateReq) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} - -// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise -// -//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} -func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} diff --git a/vendor/github.com/google/go-github/v82/github/with_appengine.go b/vendor/github.com/google/go-github/v82/github/with_appengine.go deleted file mode 100644 index 9bb95b8c8..000000000 --- a/vendor/github.com/google/go-github/v82/github/with_appengine.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build appengine - -// This file provides glue for making github work on App Engine. - -package github - -import ( - "context" - "net/http" -) - -func withContext(ctx context.Context, req *http.Request) *http.Request { - // No-op because App Engine adds context to a request differently. - return req -} diff --git a/vendor/github.com/google/go-github/v82/github/without_appengine.go b/vendor/github.com/google/go-github/v82/github/without_appengine.go deleted file mode 100644 index bfdb18ecb..000000000 --- a/vendor/github.com/google/go-github/v82/github/without_appengine.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !appengine - -// This file provides glue for making github work without App Engine. - -package github - -import ( - "context" - "net/http" -) - -func withContext(ctx context.Context, req *http.Request) *http.Request { - return req.WithContext(ctx) -} diff --git a/vendor/github.com/google/go-github/v82/AUTHORS b/vendor/github.com/google/go-github/v85/AUTHORS similarity index 96% rename from vendor/github.com/google/go-github/v82/AUTHORS rename to vendor/github.com/google/go-github/v85/AUTHORS index bf789bef0..2270852e5 100644 --- a/vendor/github.com/google/go-github/v82/AUTHORS +++ b/vendor/github.com/google/go-github/v85/AUTHORS @@ -12,6 +12,7 @@ 2BFL 413x 6543 <6543@obermui.de> +Aaron LaBrie Abed Kibbe Abhijit Hota Abhinav Gupta @@ -77,6 +78,7 @@ Arda Kuyumcu Ary Arıl Bozoluk Asier Marruedo +Austen Stone Austin Burdine Austin Dizzy Azuka Okuleye @@ -101,6 +103,7 @@ Bradley Falzon Bradley McAllister Brandon Butler Brandon Cook +Brandon Everett Brandon Stubbs Brett Kuhlman Brett Logan @@ -130,7 +133,9 @@ Christian Muehlhaeuser Christoph Jerolimov Christoph Sassenberg CI Monk +Claus Näveke Clemens W +cointem Colby Williams Colin Misare Craig Gumbley @@ -157,6 +162,7 @@ Davide Zipeto Dennis Webb Derek Jobst DeviousLab +Dhananjay Mishra Dhi Aurrahman Diego Lapiduz Diogo Vilela @@ -208,6 +214,7 @@ Glen Mailer Gnahz Google Inc. Grachev Mikhail +Gregor Jasny Gregory Oschwald griffin_stewie guangwu @@ -227,6 +234,7 @@ Huy Tr huydx i2bskn Iain Steers +Iehana Fu Ikko Ashimine Ilia Choly Ioannis Georgoulas @@ -239,6 +247,7 @@ Jake Krammer Jake Scaltreto Jake White Jameel Haffejee +James Alseth James Bowes James Cockbain James Loh @@ -261,6 +270,7 @@ Jesse Newland Jihoon Chung Jille Timmermans Jimmi Dyson +Jiří Žižkovský Joan Saum JoannaaKL Joe Tsai @@ -312,6 +322,7 @@ kyokomi Lachlan Cooper Lars Lehtonen Laurent Verdoïa +Leonard Sheng Sheng Lee leopoldwang Liam Galvin Liam Stanley @@ -332,6 +343,8 @@ Léo Salé M. Ryan Rigdon Magnus Kulke Maksim Zhylinski +Manas Sivakumar +Manav Sharma Manuel Bergler Marc Binder Marcelo Carlos @@ -343,6 +356,8 @@ Marwan Sulaiman Masayuki Izumi Mat Geist Matheus Santos Araújo +MathewClegg +Mathieu Sévégny Matija Horvat Matin Rahmanian Matt @@ -356,6 +371,7 @@ Matt Simons Matthew Reidy Maxime Bury Michael Meng +Michael Recachinas Michael Spiegel Michael Tiller Michał Glapa @@ -365,6 +381,7 @@ Mike Ball Mike Chen Miles Crabill Mishin Nikolai +Mohamad Al-Zawahreh mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili Mohammed Nafees @@ -449,6 +466,7 @@ Riaje Ricco Førgaard Richard de Vries Rob Figueiredo +Roger Peppe Rohit Upadhyay Rojan Dinc Roman Wu @@ -478,6 +496,7 @@ Sanket Payghan Sarah Funkhouser Sarasa Kisaragi Sasha Melentyev +Scott Dawson Sean Wang Sebastian Mandrean Sebastian Mæland Pedersen @@ -542,6 +561,7 @@ Victor Castell Victor Vrantchan Victory Osikwemhe vikkyomkar +Ville Skyttä Vivek Vivek Kumar Sahu Vlad Ungureanu @@ -564,6 +584,7 @@ Yumikiyo Osanai Yurii Soldak Yusef Mohamadi Yusuke Kuoka +Yuto Kimura Zach Latta Ze Peng zhouhaibing089 diff --git a/vendor/github.com/google/go-github/v82/LICENSE b/vendor/github.com/google/go-github/v85/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v82/LICENSE rename to vendor/github.com/google/go-github/v85/LICENSE diff --git a/vendor/github.com/google/go-github/v82/github/actions.go b/vendor/github.com/google/go-github/v85/github/actions.go similarity index 79% rename from vendor/github.com/google/go-github/v82/github/actions.go rename to vendor/github.com/google/go-github/v85/github/actions.go index 4b88a1e11..575a637a2 100644 --- a/vendor/github.com/google/go-github/v82/github/actions.go +++ b/vendor/github.com/google/go-github/v85/github/actions.go @@ -8,5 +8,5 @@ package github // ActionsService handles communication with the actions related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/actions/ +// GitHub API docs: https://docs.github.com/rest/actions?apiVersion=2022-11-28 type ActionsService service diff --git a/vendor/github.com/google/go-github/v82/github/actions_artifacts.go b/vendor/github.com/google/go-github/v85/github/actions_artifacts.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v85/github/actions_artifacts.go index 4185a1503..a47933708 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v85/github/actions_artifacts.go @@ -14,7 +14,7 @@ import ( // ArtifactWorkflowRun represents a GitHub artifact's workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28 type ArtifactWorkflowRun struct { ID *int64 `json:"id,omitempty"` RepositoryID *int64 `json:"repository_id,omitempty"` @@ -27,7 +27,7 @@ type ArtifactWorkflowRun struct { // data between jobs in a workflow and provide storage for data // once a workflow is complete. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28 type Artifact struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -48,7 +48,7 @@ type Artifact struct { // ArtifactList represents a list of GitHub artifacts. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#artifacts type ArtifactList struct { TotalCount *int64 `json:"total_count,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` @@ -81,7 +81,7 @@ type ArtifactPeriodOpt struct { // ListArtifacts lists all artifacts that belong to a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#list-artifacts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListArtifactsOptions) (*ArtifactList, *Response, error) { @@ -96,8 +96,8 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, return nil, nil, err } - artifactList := new(ArtifactList) - resp, err := s.client.Do(ctx, req, artifactList) + var artifactList *ArtifactList + resp, err := s.client.Do(ctx, req, &artifactList) if err != nil { return nil, resp, err } @@ -107,7 +107,7 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, // ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { @@ -122,8 +122,8 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re return nil, nil, err } - artifactList := new(ArtifactList) - resp, err := s.client.Do(ctx, req, artifactList) + var artifactList *ArtifactList + resp, err := s.client.Do(ctx, req, &artifactList) if err != nil { return nil, resp, err } @@ -133,7 +133,7 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re // GetArtifact gets a specific artifact for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#get-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#get-an-artifact // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { @@ -144,8 +144,8 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar return nil, nil, err } - artifact := new(Artifact) - resp, err := s.client.Do(ctx, req, artifact) + var artifact *Artifact + resp, err := s.client.Do(ctx, req, &artifact) if err != nil { return nil, resp, err } @@ -155,7 +155,7 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#download-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { @@ -209,7 +209,7 @@ func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u st // DeleteArtifact deletes a workflow run artifact. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact // //meta:operation DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_cache.go b/vendor/github.com/google/go-github/v85/github/actions_cache.go similarity index 79% rename from vendor/github.com/google/go-github/v82/github/actions_cache.go rename to vendor/github.com/google/go-github/v85/github/actions_cache.go index 852e9860f..50af77c2d 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_cache.go +++ b/vendor/github.com/google/go-github/v85/github/actions_cache.go @@ -12,7 +12,7 @@ import ( // ActionsCache represents a GitHub action cache. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#about-the-cache-api +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#about-the-cache-api type ActionsCache struct { ID *int64 `json:"id,omitempty" url:"-"` Ref *string `json:"ref,omitempty" url:"ref"` @@ -25,7 +25,7 @@ type ActionsCache struct { // ActionsCacheList represents a list of GitHub actions Cache. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository type ActionsCacheList struct { TotalCount int `json:"total_count"` ActionsCaches []*ActionsCache `json:"actions_caches,omitempty"` @@ -33,7 +33,7 @@ type ActionsCacheList struct { // ActionsCacheUsage represents a GitHub Actions Cache Usage object. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsage struct { FullName string `json:"full_name"` ActiveCachesSizeInBytes int64 `json:"active_caches_size_in_bytes"` @@ -42,7 +42,7 @@ type ActionsCacheUsage struct { // ActionsCacheUsageList represents a list of repositories with GitHub Actions cache usage for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsageList struct { TotalCount int `json:"total_count"` RepoCacheUsage []*ActionsCacheUsage `json:"repository_cache_usages,omitempty"` @@ -50,7 +50,7 @@ type ActionsCacheUsageList struct { // TotalCacheUsage represents total GitHub actions cache usage of an organization or enterprise. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise type TotalCacheUsage struct { TotalActiveCachesUsageSizeInBytes int64 `json:"total_active_caches_size_in_bytes"` TotalActiveCachesCount int `json:"total_active_caches_count"` @@ -58,7 +58,7 @@ type TotalCacheUsage struct { // ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository type ActionsCacheListOptions struct { ListOptions // The Git reference for the results you want to list. @@ -77,7 +77,7 @@ type ActionsCacheListOptions struct { // // Permissions: must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/caches func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) { @@ -92,8 +92,8 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt return nil, nil, err } - actionCacheList := new(ActionsCacheList) - resp, err := s.client.Do(ctx, req, actionCacheList) + var actionCacheList *ActionsCacheList + resp, err := s.client.Do(ctx, req, &actionCacheList) if err != nil { return nil, resp, err } @@ -109,12 +109,12 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key // //meta:operation DELETE /repos/{owner}/{repo}/actions/caches func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) - u, err := addOptions(u, ActionsCache{Key: &key, Ref: ref}) + u, err := addOptions(u, &ActionsCache{Key: &key, Ref: ref}) if err != nil { return nil, err } @@ -131,7 +131,7 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id // //meta:operation DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) { @@ -150,7 +150,7 @@ func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo strin // Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an // access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/cache/usage func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) { @@ -160,8 +160,8 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s return nil, nil, err } - cacheUsage := new(ActionsCacheUsage) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *ActionsCacheUsage + res, err := s.client.Do(ctx, req, &cacheUsage) if err != nil { return nil, res, err } @@ -175,7 +175,7 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_administration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization // //meta:operation GET /orgs/{org}/actions/cache/usage-by-repository func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) { @@ -190,8 +190,8 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str return nil, nil, err } - cacheUsage := new(ActionsCacheUsageList) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *ActionsCacheUsageList + res, err := s.client.Do(ctx, req, &cacheUsage) if err != nil { return nil, res, err } @@ -205,7 +205,7 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_administration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization // //meta:operation GET /orgs/{org}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) { @@ -215,8 +215,8 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin return nil, nil, err } - cacheUsage := new(TotalCacheUsage) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *TotalCacheUsage + res, err := s.client.Do(ctx, req, &cacheUsage) if err != nil { return nil, res, err } @@ -229,7 +229,7 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin // // Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { @@ -239,8 +239,8 @@ func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, en return nil, nil, err } - cacheUsage := new(TotalCacheUsage) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *TotalCacheUsage + res, err := s.client.Do(ctx, req, &cacheUsage) if err != nil { return nil, res, err } diff --git a/vendor/github.com/google/go-github/v82/github/actions_hosted_runners.go b/vendor/github.com/google/go-github/v85/github/actions_hosted_runners.go similarity index 53% rename from vendor/github.com/google/go-github/v82/github/actions_hosted_runners.go rename to vendor/github.com/google/go-github/v85/github/actions_hosted_runners.go index 207b755fc..a4dd4f520 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_hosted_runners.go +++ b/vendor/github.com/google/go-github/v85/github/actions_hosted_runners.go @@ -58,7 +58,7 @@ type HostedRunners struct { // ListHostedRunners lists all the GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-github-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error) { @@ -73,7 +73,7 @@ func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts return nil, nil, err } - runners := &HostedRunners{} + var runners *HostedRunners resp, err := s.client.Do(ctx, req, &runners) if err != nil { return nil, resp, err @@ -83,58 +83,65 @@ func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts } // HostedRunnerImage represents the image of GitHub-hosted runners. -// To list all available images, use GET /actions/hosted-runners/images/github-owned or GET /actions/hosted-runners/images/partner. type HostedRunnerImage struct { - ID string `json:"id"` - Source string `json:"source"` - Version string `json:"version"` + // The unique identifier of the runner image. + ID string `json:"id"` + // The source of the runner image. Can be one of: github, partner, custom. + Source string `json:"source"` + // The version of the runner image to deploy. This is relevant only for runners using custom images. + Version *string `json:"version,omitempty"` } -// HostedRunnerRequest specifies body parameters to Hosted Runner configuration. -type HostedRunnerRequest struct { - Name string `json:"name,omitempty"` - Image HostedRunnerImage `json:"image,omitempty"` - RunnerGroupID int64 `json:"runner_group_id,omitempty"` - Size string `json:"size,omitempty"` - MaximumRunners int64 `json:"maximum_runners,omitempty"` - EnableStaticIP bool `json:"enable_static_ip,omitempty"` - ImageVersion string `json:"image_version,omitempty"` +// CreateHostedRunnerRequest specifies body parameters to create Hosted Runner configuration. +type CreateHostedRunnerRequest struct { + Name string `json:"name"` + Image HostedRunnerImage `json:"image"` + Size string `json:"size"` + RunnerGroupID int64 `json:"runner_group_id"` + MaximumRunners *int64 `json:"maximum_runners,omitempty"` + EnableStaticIP *bool `json:"enable_static_ip,omitempty"` + ImageGen *bool `json:"image_gen,omitempty"` } -// validateCreateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure +// UpdateHostedRunnerRequest specifies body parameters to update Hosted Runner configuration. +type UpdateHostedRunnerRequest struct { + Name *string `json:"name,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` + MaximumRunners *int64 `json:"maximum_runners,omitempty"` + EnableStaticIP *bool `json:"enable_static_ip,omitempty"` + Size *string `json:"size,omitempty"` + ImageID *string `json:"image_id,omitempty"` + ImageVersion *string `json:"image_version,omitempty"` +} + +// validateCreateHostedRunnerRequest validates the provided CreateHostedRunnerRequest to ensure // that all required fields are properly set and that no invalid fields are present for hosted runner create request. // // If any of these conditions are violated, an appropriate error message is returned. // Otherwise, nil is returned, indicating the request is valid. -func validateCreateHostedRunnerRequest(request *HostedRunnerRequest) error { - if request == nil { - return errors.New("request is required for creating a hosted runner") - } - if request.Size == "" { - return errors.New("size is required for creating a hosted runner") +func validateCreateHostedRunnerRequest(request *CreateHostedRunnerRequest) error { + if request.Name == "" { + return errors.New("name is required for creating a hosted runner") } if request.Image == (HostedRunnerImage{}) { return errors.New("image is required for creating a hosted runner") } - if request.Name == "" { - return errors.New("name is required for creating a hosted runner") + if request.Size == "" { + return errors.New("size is required for creating a hosted runner") } if request.RunnerGroupID == 0 { return errors.New("runner group ID is required for creating a hosted runner") } - if request.ImageVersion != "" { - return errors.New("imageVersion should not be set directly; use the Image struct to specify image details") - } return nil } // CreateHostedRunner creates a GitHub-hosted runner for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#create-a-github-hosted-runner-for-an-organization // //meta:operation POST /orgs/{org}/actions/hosted-runners -func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { - if err := validateCreateHostedRunnerRequest(request); err != nil { +func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(&request); err != nil { return nil, nil, fmt.Errorf("validation failed: %w", err) } @@ -144,8 +151,8 @@ func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, req return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) if err != nil { return nil, resp, err } @@ -153,6 +160,39 @@ func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, req return hostedRunner, resp, nil } +// HostedRunnerCustomImage represents a custom image definition for GitHub-hosted runners. +type HostedRunnerCustomImage struct { + ID int64 `json:"id"` + Platform string `json:"platform"` + Name string `json:"name"` + Source string `json:"source"` + VersionsCount int `json:"versions_count"` + TotalVersionsSize int `json:"total_versions_size"` + LatestVersion string `json:"latest_version"` + State string `json:"state"` +} + +// HostedRunnerCustomImages represents a collection of custom images for GitHub-hosted runners. +type HostedRunnerCustomImages struct { + TotalCount int `json:"total_count"` + Images []*HostedRunnerCustomImage `json:"images"` +} + +// HostedRunnerCustomImageVersion represents a version of a custom image for GitHub-hosted runners. +type HostedRunnerCustomImageVersion struct { + Version string `json:"version"` + SizeGB int `json:"size_gb"` + State string `json:"state"` + StateDetails string `json:"state_details"` + CreatedOn Timestamp `json:"created_on"` +} + +// HostedRunnerCustomImageVersions represents a collection of versions of a custom image. +type HostedRunnerCustomImageVersions struct { + TotalCount int `json:"total_count"` + ImageVersions []*HostedRunnerCustomImageVersion `json:"image_versions"` +} + // HostedRunnerImageSpecs represents the details of a GitHub-hosted runner image. type HostedRunnerImageSpecs struct { ID string `json:"id"` @@ -170,7 +210,7 @@ type HostedRunnerImages struct { // GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-owned-images-for-github-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/images/github-owned func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { @@ -180,8 +220,8 @@ func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, o return nil, nil, err } - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(ctx, req, &hostedRunnerImages) if err != nil { return nil, resp, err } @@ -191,7 +231,7 @@ func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, o // GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-partner-images-for-github-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/images/partner func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { @@ -201,8 +241,8 @@ func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org s return nil, nil, err } - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(ctx, req, &hostedRunnerImages) if err != nil { return nil, resp, err } @@ -223,7 +263,7 @@ type PublicIPUsage struct { // GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-limits-on-github-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/limits func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error) { @@ -233,8 +273,8 @@ func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) return nil, nil, err } - publicIPLimits := new(HostedRunnerPublicIPLimits) - resp, err := s.client.Do(ctx, req, publicIPLimits) + var publicIPLimits *HostedRunnerPublicIPLimits + resp, err := s.client.Do(ctx, req, &publicIPLimits) if err != nil { return nil, resp, err } @@ -250,7 +290,7 @@ type HostedRunnerMachineSpecs struct { // GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-hosted-runners-machine-specs-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/machine-sizes func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error) { @@ -260,8 +300,8 @@ func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org st return nil, nil, err } - machineSpecs := new(HostedRunnerMachineSpecs) - resp, err := s.client.Do(ctx, req, machineSpecs) + var machineSpecs *HostedRunnerMachineSpecs + resp, err := s.client.Do(ctx, req, &machineSpecs) if err != nil { return nil, resp, err } @@ -277,7 +317,7 @@ type HostedRunnerPlatforms struct { // GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-platforms-for-github-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/platforms func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error) { @@ -287,8 +327,8 @@ func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org strin return nil, nil, err } - platforms := new(HostedRunnerPlatforms) - resp, err := s.client.Do(ctx, req, platforms) + var platforms *HostedRunnerPlatforms + resp, err := s.client.Do(ctx, req, &platforms) if err != nil { return nil, resp, err } @@ -298,7 +338,7 @@ func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org strin // GetHostedRunner gets a GitHub-hosted runner in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-github-hosted-runner-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id} func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { @@ -308,8 +348,8 @@ func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runner return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) if err != nil { return nil, resp, err } @@ -317,39 +357,20 @@ func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runner return hostedRunner, resp, nil } -// validateUpdateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure -// that no disallowed updates are made for a hosted runner update request. -// -// If any of these conditions are violated, an appropriate error message is returned. -// Otherwise, nil is returned, indicating the request is valid for an update. -func validateUpdateHostedRunnerRequest(request *HostedRunnerRequest) error { - if request.Size != "" { - return errors.New("size cannot be updated, API does not support updating size") - } - if request.Image != (HostedRunnerImage{}) { - return errors.New("image struct should not be set directly; use the ImageVersion to specify version details") - } - return nil -} - // UpdateHostedRunner updates a GitHub-hosted runner for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#update-a-github-hosted-runner-for-an-organization // //meta:operation PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id} -func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { - if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { - return nil, nil, fmt.Errorf("validation failed: %w", err) - } - +func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) - req, err := s.client.NewRequest("PATCH", u, updateReq) + req, err := s.client.NewRequest("PATCH", u, request) if err != nil { return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) if err != nil { return nil, resp, err } @@ -359,7 +380,7 @@ func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, run // DeleteHostedRunner deletes GitHub-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-github-hosted-runner-for-an-organization // //meta:operation DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id} func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { @@ -369,11 +390,125 @@ func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, run return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) if err != nil { return nil, resp, err } return hostedRunner, resp, nil } + +// ListHostedRunnerCustomImages lists custom images for GitHub-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-custom-images-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom +func (s *ActionsService) ListHostedRunnerCustomImages(ctx context.Context, org string) (*HostedRunnerCustomImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var images *HostedRunnerCustomImages + resp, err := s.client.Do(ctx, req, &images) + if err != nil { + return nil, resp, err + } + + return images, resp, nil +} + +// GetHostedRunnerCustomImage gets a custom image definition for GitHub-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-custom-image-definition-for-github-actions-hosted-runners +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *ActionsService) GetHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImage, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v", org, imageDefinitionID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var image *HostedRunnerCustomImage + resp, err := s.client.Do(ctx, req, &image) + if err != nil { + return nil, resp, err + } + + return image, resp, nil +} + +// DeleteHostedRunnerCustomImage deletes a custom image from the organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-custom-image-from-the-organization +// +//meta:operation DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *ActionsService) DeleteHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v", org, imageDefinitionID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListHostedRunnerCustomImageVersions lists image versions of a custom image for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-image-versions-of-a-custom-image-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions +func (s *ActionsService) ListHostedRunnerCustomImageVersions(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImageVersions, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v/versions", org, imageDefinitionID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var versions *HostedRunnerCustomImageVersions + resp, err := s.client.Do(ctx, req, &versions) + if err != nil { + return nil, resp, err + } + + return versions, resp, nil +} + +// GetHostedRunnerCustomImageVersion gets an image version of a custom image for GitHub-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-an-image-version-of-a-custom-image-for-github-actions-hosted-runners +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *ActionsService) GetHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*HostedRunnerCustomImageVersion, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v/versions/%v", org, imageDefinitionID, version) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var imageVersion *HostedRunnerCustomImageVersion + resp, err := s.client.Do(ctx, req, &imageVersion) + if err != nil { + return nil, resp, err + } + + return imageVersion, resp, nil +} + +// DeleteHostedRunnerCustomImageVersion deletes an image version of a custom image from the organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-an-image-version-of-custom-image-from-the-organization +// +//meta:operation DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *ActionsService) DeleteHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v/versions/%v", org, imageDefinitionID, version) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v82/github/actions_oidc.go b/vendor/github.com/google/go-github/v85/github/actions_oidc.go similarity index 80% rename from vendor/github.com/google/go-github/v82/github/actions_oidc.go rename to vendor/github.com/google/go-github/v85/github/actions_oidc.go index 596aa9d98..e1b8301c4 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_oidc.go +++ b/vendor/github.com/google/go-github/v85/github/actions_oidc.go @@ -18,7 +18,7 @@ type OIDCSubjectClaimCustomTemplate struct { // GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization // //meta:operation GET /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { @@ -28,7 +28,7 @@ func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { @@ -42,8 +42,8 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, return nil, nil, err } - tmpl := new(OIDCSubjectClaimCustomTemplate) - resp, err := s.client.Do(ctx, req, tmpl) + var tmpl *OIDCSubjectClaimCustomTemplate + resp, err := s.client.Do(ctx, req, &tmpl) if err != nil { return nil, resp, err } @@ -53,7 +53,7 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, // SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization // //meta:operation PUT /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { @@ -63,7 +63,7 @@ func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_permissions_enterprise.go b/vendor/github.com/google/go-github/v85/github/actions_permissions_enterprise.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/actions_permissions_enterprise.go rename to vendor/github.com/google/go-github/v85/github/actions_permissions_enterprise.go index 326230d64..23d577f7d 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_permissions_enterprise.go +++ b/vendor/github.com/google/go-github/v85/github/actions_permissions_enterprise.go @@ -18,7 +18,7 @@ type ActionsEnabledOnEnterpriseRepos struct { // ActionsPermissionsEnterprise represents a policy for allowed actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28 type ActionsPermissionsEnterprise struct { EnabledOrganizations *string `json:"enabled_organizations,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -31,7 +31,7 @@ func (a ActionsPermissionsEnterprise) String() string { // DefaultWorkflowPermissionEnterprise represents the default permissions for GitHub Actions workflows for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28 type DefaultWorkflowPermissionEnterprise struct { DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` @@ -48,7 +48,7 @@ func (a SelfHostRunnerPermissionsEnterprise) String() string { // GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissionsEnterprise, *Response, error) { @@ -59,8 +59,8 @@ func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, return nil, nil, err } - permissions := new(ActionsPermissionsEnterprise) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissionsEnterprise + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -70,7 +70,7 @@ func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, // UpdateActionsPermissionsInEnterprise sets the permissions policy in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions func (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissionsEnterprise ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error) { @@ -80,8 +80,8 @@ func (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Contex return nil, nil, err } - p := new(ActionsPermissionsEnterprise) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsPermissionsEnterprise + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -91,7 +91,7 @@ func (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Contex // ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#list-selected-organizations-enabled-for-github-actions-in-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error) { @@ -106,8 +106,8 @@ func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner return nil, nil, err } - orgs := &ActionsEnabledOnEnterpriseRepos{} - resp, err := s.client.Do(ctx, req, orgs) + var orgs *ActionsEnabledOnEnterpriseRepos + resp, err := s.client.Do(ctx, req, &orgs) if err != nil { return nil, resp, err } @@ -117,7 +117,7 @@ func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner // SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-selected-organizations-enabled-for-github-actions-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner string, organizationIDs []int64) (*Response, error) { @@ -140,7 +140,7 @@ func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner s // AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#enable-a-selected-organization-for-github-actions-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { @@ -161,7 +161,7 @@ func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner st // RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#disable-a-selected-organization-for-github-actions-in-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { @@ -182,7 +182,7 @@ func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner // GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error) { @@ -193,8 +193,8 @@ func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, ente return nil, nil, err } - actionsAllowed := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, actionsAllowed) + var actionsAllowed *ActionsAllowed + resp, err := s.client.Do(ctx, req, &actionsAllowed) if err != nil { return nil, resp, err } @@ -204,7 +204,7 @@ func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, ente // UpdateActionsAllowedInEnterprise sets the actions that are allowed in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { @@ -214,8 +214,8 @@ func (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, e return nil, nil, err } - p := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsAllowed + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -225,7 +225,7 @@ func (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, e // GetDefaultWorkflowPermissionsInEnterprise gets the GitHub Actions default workflow permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/workflow func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string) (*DefaultWorkflowPermissionEnterprise, *Response, error) { @@ -236,8 +236,8 @@ func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.C return nil, nil, err } - permissions := new(DefaultWorkflowPermissionEnterprise) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *DefaultWorkflowPermissionEnterprise + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -247,7 +247,7 @@ func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.C // UpdateDefaultWorkflowPermissionsInEnterprise sets the GitHub Actions default workflow permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/workflow func (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string, permissions DefaultWorkflowPermissionEnterprise) (*DefaultWorkflowPermissionEnterprise, *Response, error) { @@ -257,8 +257,8 @@ func (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx contex return nil, nil, err } - p := new(DefaultWorkflowPermissionEnterprise) - resp, err := s.client.Do(ctx, req, p) + var p *DefaultWorkflowPermissionEnterprise + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -268,7 +268,7 @@ func (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx contex // GetArtifactAndLogRetentionPeriodInEnterprise gets the artifact and log retention period for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string) (*ArtifactPeriod, *Response, error) { @@ -279,8 +279,8 @@ func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx contex return nil, nil, err } - arp := new(ArtifactPeriod) - resp, err := s.client.Do(ctx, req, arp) + var arp *ArtifactPeriod + resp, err := s.client.Do(ctx, req, &arp) if err != nil { return nil, resp, err } @@ -290,7 +290,7 @@ func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx contex // UpdateArtifactAndLogRetentionPeriodInEnterprise sets the artifact and log retention period for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string, period ArtifactPeriodOpt) (*Response, error) { @@ -305,7 +305,7 @@ func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx con // GetSelfHostedRunnerPermissionsInEnterprise gets the self-hosted runner permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-self-hosted-runners-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-self-hosted-runners-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/self-hosted-runners func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string) (*SelfHostRunnerPermissionsEnterprise, *Response, error) { @@ -315,8 +315,8 @@ func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context. return nil, nil, err } - permissions := new(SelfHostRunnerPermissionsEnterprise) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *SelfHostRunnerPermissionsEnterprise + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -326,7 +326,7 @@ func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context. // UpdateSelfHostedRunnerPermissionsInEnterprise sets the self-hosted runner permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-self-hosted-runners-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-self-hosted-runners-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/self-hosted-runners func (s *ActionsService) UpdateSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string, permissions SelfHostRunnerPermissionsEnterprise) (*Response, error) { @@ -341,7 +341,7 @@ func (s *ActionsService) UpdateSelfHostedRunnerPermissionsInEnterprise(ctx conte // GetPrivateRepoForkPRWorkflowSettingsInEnterprise gets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string) (*WorkflowsPermissions, *Response, error) { @@ -352,8 +352,8 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx co return nil, nil, err } - permissions := new(WorkflowsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *WorkflowsPermissions + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -363,7 +363,7 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx co // UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise sets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, permissions *WorkflowsPermissionsOpt) (*Response, error) { @@ -378,7 +378,7 @@ func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx // GetEnterpriseForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string) (*ContributorApprovalPermissions, *Response, error) { @@ -389,8 +389,8 @@ func (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx c return nil, nil, err } - policy := new(ContributorApprovalPermissions) - resp, err := s.client.Do(ctx, req, policy) + var policy *ContributorApprovalPermissions + resp, err := s.client.Do(ctx, req, &policy) if err != nil { return nil, resp, err } @@ -400,7 +400,7 @@ func (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx c // UpdateEnterpriseForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) UpdateEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string, policy ContributorApprovalPermissions) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_permissions_orgs.go b/vendor/github.com/google/go-github/v85/github/actions_permissions_orgs.go similarity index 85% rename from vendor/github.com/google/go-github/v82/github/actions_permissions_orgs.go rename to vendor/github.com/google/go-github/v85/github/actions_permissions_orgs.go index 626e39983..d81e22486 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_permissions_orgs.go +++ b/vendor/github.com/google/go-github/v85/github/actions_permissions_orgs.go @@ -12,7 +12,7 @@ import ( // ActionsPermissions represents a policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type ActionsPermissions struct { EnabledRepositories *string `json:"enabled_repositories,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -32,7 +32,7 @@ type ActionsEnabledOnOrgRepos struct { // ActionsAllowed represents selected actions that are allowed. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type ActionsAllowed struct { GithubOwnedAllowed *bool `json:"github_owned_allowed,omitempty"` VerifiedAllowed *bool `json:"verified_allowed,omitempty"` @@ -45,7 +45,7 @@ func (a ActionsAllowed) String() string { // DefaultWorkflowPermissionOrganization represents the default permissions for GitHub Actions workflows for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type DefaultWorkflowPermissionOrganization struct { DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` @@ -68,7 +68,7 @@ type SelfHostedRunnersSettingsOrganizationOpt struct { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { @@ -79,8 +79,8 @@ func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) return nil, nil, err } - permissions := new(ActionsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissions + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -90,7 +90,7 @@ func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) // UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions func (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { @@ -100,8 +100,8 @@ func (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org strin return nil, nil, err } - p := new(ActionsPermissions) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsPermissions + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -111,7 +111,7 @@ func (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org strin // ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#list-selected-repositories-enabled-for-github-actions-in-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/repositories func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { @@ -126,8 +126,8 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string return nil, nil, err } - repos := &ActionsEnabledOnOrgRepos{} - resp, err := s.client.Do(ctx, req, repos) + var repos *ActionsEnabledOnOrgRepos + resp, err := s.client.Do(ctx, req, &repos) if err != nil { return nil, resp, err } @@ -137,7 +137,7 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string // SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-selected-repositories-enabled-for-github-actions-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/repositories func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { @@ -160,7 +160,7 @@ func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, // AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#enable-a-selected-repository-for-github-actions-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { @@ -181,7 +181,7 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, // RemoveEnabledReposInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#disable-a-selected-repository-for-github-actions-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { @@ -202,7 +202,7 @@ func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner stri // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { @@ -213,8 +213,8 @@ func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*Ac return nil, nil, err } - actionsAllowed := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, actionsAllowed) + var actionsAllowed *ActionsAllowed + resp, err := s.client.Do(ctx, req, &actionsAllowed) if err != nil { return nil, resp, err } @@ -224,7 +224,7 @@ func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*Ac // UpdateActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { @@ -234,8 +234,8 @@ func (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, a return nil, nil, err } - p := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsAllowed + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -245,7 +245,7 @@ func (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, a // GetDefaultWorkflowPermissionsInOrganization gets the GitHub Actions default workflow permissions for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/workflow func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string) (*DefaultWorkflowPermissionOrganization, *Response, error) { @@ -256,8 +256,8 @@ func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context return nil, nil, err } - permissions := new(DefaultWorkflowPermissionOrganization) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *DefaultWorkflowPermissionOrganization + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -267,7 +267,7 @@ func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context // UpdateDefaultWorkflowPermissionsInOrganization sets the GitHub Actions default workflow permissions for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/workflow func (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string, permissions DefaultWorkflowPermissionOrganization) (*DefaultWorkflowPermissionOrganization, *Response, error) { @@ -277,8 +277,8 @@ func (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx cont return nil, nil, err } - p := new(DefaultWorkflowPermissionOrganization) - resp, err := s.client.Do(ctx, req, p) + var p *DefaultWorkflowPermissionOrganization + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -288,7 +288,7 @@ func (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx cont // GetArtifactAndLogRetentionPeriodInOrganization gets the artifact and log retention period for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/artifact-and-log-retention func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string) (*ArtifactPeriod, *Response, error) { @@ -299,8 +299,8 @@ func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx cont return nil, nil, err } - arp := new(ArtifactPeriod) - resp, err := s.client.Do(ctx, req, arp) + var arp *ArtifactPeriod + resp, err := s.client.Do(ctx, req, &arp) if err != nil { return nil, resp, err } @@ -310,7 +310,7 @@ func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx cont // UpdateArtifactAndLogRetentionPeriodInOrganization sets the artifact and log retention period for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/artifact-and-log-retention func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string, period ArtifactPeriodOpt) (*Response, error) { @@ -325,7 +325,7 @@ func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInOrganization(ctx c // GetSelfHostedRunnersSettingsInOrganization gets the self-hosted runners permissions settings for repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-self-hosted-runners-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-self-hosted-runners-settings-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string) (*SelfHostedRunnersSettingsOrganization, *Response, error) { @@ -336,8 +336,8 @@ func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context. return nil, nil, err } - settings := new(SelfHostedRunnersSettingsOrganization) - resp, err := s.client.Do(ctx, req, settings) + var settings *SelfHostedRunnersSettingsOrganization + resp, err := s.client.Do(ctx, req, &settings) if err != nil { return nil, resp, err } @@ -347,7 +347,7 @@ func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context. // UpdateSelfHostedRunnersSettingsInOrganization sets the self-hosted runners permissions settings for repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-self-hosted-runners-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-self-hosted-runners-settings-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners func (s *ActionsService) UpdateSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string, opt SelfHostedRunnersSettingsOrganizationOpt) (*Response, error) { @@ -369,7 +369,7 @@ type SelfHostedRunnersAllowedRepos struct { // ListRepositoriesSelfHostedRunnersAllowedInOrganization lists the repositories that are allowed to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, opts *ListOptions) (*SelfHostedRunnersAllowedRepos, *Response, error) { @@ -384,8 +384,8 @@ func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization( return nil, nil, err } - settings := new(SelfHostedRunnersAllowedRepos) - resp, err := s.client.Do(ctx, req, settings) + var settings *SelfHostedRunnersAllowedRepos + resp, err := s.client.Do(ctx, req, &settings) if err != nil { return nil, resp, err } @@ -395,7 +395,7 @@ func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization( // SetRepositoriesSelfHostedRunnersAllowedInOrganization allows the list of repositories to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories func (s *ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) { @@ -413,7 +413,7 @@ func (s *ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization(c // AddRepositorySelfHostedRunnersAllowedInOrganization adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#add-a-repository-to-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#add-a-repository-to-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id} func (s *ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) { @@ -429,7 +429,7 @@ func (s *ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization(ctx // RemoveRepositorySelfHostedRunnersAllowedInOrganization removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#remove-a-repository-from-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#remove-a-repository-from-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id} func (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) { @@ -450,7 +450,7 @@ func (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization( // GetPrivateRepoForkPRWorkflowSettingsInOrganization gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string) (*WorkflowsPermissions, *Response, error) { @@ -461,8 +461,8 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx return nil, nil, err } - permissions := new(WorkflowsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *WorkflowsPermissions + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -472,7 +472,7 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx // UpdatePrivateRepoForkPRWorkflowSettingsInOrganization sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, permissions *WorkflowsPermissionsOpt) (*Response, error) { @@ -487,7 +487,7 @@ func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(c // GetOrganizationForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string) (*ContributorApprovalPermissions, *Response, error) { @@ -498,8 +498,8 @@ func (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx return nil, nil, err } - policy := new(ContributorApprovalPermissions) - resp, err := s.client.Do(ctx, req, policy) + var policy *ContributorApprovalPermissions + resp, err := s.client.Do(ctx, req, &policy) if err != nil { return nil, resp, err } @@ -509,7 +509,7 @@ func (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx // UpdateOrganizationForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) UpdateOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string, policy ContributorApprovalPermissions) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v85/github/actions_runner_groups.go similarity index 83% rename from vendor/github.com/google/go-github/v82/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v85/github/actions_runner_groups.go index dc54a8485..fd3604b59 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_runner_groups.go +++ b/vendor/github.com/google/go-github/v85/github/actions_runner_groups.go @@ -85,7 +85,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { @@ -100,7 +100,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s return nil, nil, err } - groups := &RunnerGroups{} + var groups *RunnerGroups resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err @@ -111,7 +111,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { @@ -121,8 +121,8 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str return nil, nil, err } - runnerGroup := new(RunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *RunnerGroup + resp, err := s.client.Do(ctx, req, &runnerGroup) if err != nil { return nil, resp, err } @@ -132,7 +132,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { @@ -148,7 +148,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-organization // //meta:operation POST /orgs/{org}/actions/runner-groups func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -158,8 +158,8 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org return nil, nil, err } - runnerGroup := new(RunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *RunnerGroup + resp, err := s.client.Do(ctx, req, &runnerGroup) if err != nil { return nil, resp, err } @@ -169,7 +169,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-organization // //meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -179,8 +179,8 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org return nil, nil, err } - runnerGroup := new(RunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *RunnerGroup + resp, err := s.client.Do(ctx, req, &runnerGroup) if err != nil { return nil, resp, err } @@ -190,7 +190,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -205,7 +205,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or return nil, nil, err } - repos := &ListRepositories{} + var repos *ListRepositories resp, err := s.client.Do(ctx, req, &repos) if err != nil { return nil, resp, err @@ -217,7 +217,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-repository-access-for-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { @@ -234,7 +234,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -251,7 +251,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -265,9 +265,35 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, return s.client.Do(ctx, req, nil) } +// ListRunnerGroupHostedRunners lists the GitHub-hosted runners in an organization runner group. +// +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-github-hosted-runners-in-a-group-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners +func (s *ActionsService) ListRunnerGroupHostedRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/hosted-runners", org, groupID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var runners *HostedRunners + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { @@ -282,7 +308,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, return nil, nil, err } - runners := &Runners{} + var runners *Runners resp, err := s.client.Do(ctx, req, &runners) if err != nil { return nil, resp, err @@ -294,7 +320,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { @@ -310,7 +336,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { @@ -327,7 +353,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_runners.go b/vendor/github.com/google/go-github/v85/github/actions_runners.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/actions_runners.go rename to vendor/github.com/google/go-github/v85/github/actions_runners.go index c4ae48232..f0282b25f 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_runners.go +++ b/vendor/github.com/google/go-github/v85/github/actions_runners.go @@ -22,7 +22,7 @@ type RunnerApplicationDownload struct { // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners/downloads func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { @@ -60,7 +60,7 @@ type JITRunnerConfig struct { // GenerateOrgJITConfig generate a just-in-time configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/generate-jitconfig func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { @@ -70,8 +70,8 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, r return nil, nil, err } - jitConfig := new(JITRunnerConfig) - resp, err := s.client.Do(ctx, req, jitConfig) + var jitConfig *JITRunnerConfig + resp, err := s.client.Do(ctx, req, &jitConfig) if err != nil { return nil, resp, err } @@ -81,7 +81,7 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, r // GenerateRepoJITConfig generates a just-in-time configuration for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { @@ -91,8 +91,8 @@ func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo return nil, nil, err } - jitConfig := new(JITRunnerConfig) - resp, err := s.client.Do(ctx, req, jitConfig) + var jitConfig *JITRunnerConfig + resp, err := s.client.Do(ctx, req, &jitConfig) if err != nil { return nil, resp, err } @@ -108,7 +108,7 @@ type RegistrationToken struct { // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/actions/runners/registration-token func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { @@ -119,8 +119,8 @@ func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, rep return nil, nil, err } - registrationToken := new(RegistrationToken) - resp, err := s.client.Do(ctx, req, registrationToken) + var registrationToken *RegistrationToken + resp, err := s.client.Do(ctx, req, ®istrationToken) if err != nil { return nil, resp, err } @@ -159,7 +159,7 @@ type ListRunnersOptions struct { // ListRunners lists all the self-hosted runners for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListRunnersOptions) (*Runners, *Response, error) { @@ -174,7 +174,7 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op return nil, nil, err } - runners := &Runners{} + var runners *Runners resp, err := s.client.Do(ctx, req, &runners) if err != nil { return nil, resp, err @@ -185,7 +185,7 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op // GetRunner gets a specific self-hosted runner for a repository using its runner ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { @@ -195,8 +195,8 @@ func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runn return nil, nil, err } - runner := new(Runner) - resp, err := s.client.Do(ctx, req, runner) + var runner *Runner + resp, err := s.client.Do(ctx, req, &runner) if err != nil { return nil, resp, err } @@ -212,7 +212,7 @@ type RemoveToken struct { // CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-remove-token-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/actions/runners/remove-token func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { @@ -223,8 +223,8 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri return nil, nil, err } - removeToken := new(RemoveToken) - resp, err := s.client.Do(ctx, req, removeToken) + var removeToken *RemoveToken + resp, err := s.client.Do(ctx, req, &removeToken) if err != nil { return nil, resp, err } @@ -234,7 +234,7 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri // RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { @@ -250,7 +250,7 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/downloads func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, org string) ([]*RunnerApplicationDownload, *Response, error) { @@ -271,7 +271,7 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/registration-token func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, org string) (*RegistrationToken, *Response, error) { @@ -282,8 +282,8 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context return nil, nil, err } - registrationToken := new(RegistrationToken) - resp, err := s.client.Do(ctx, req, registrationToken) + var registrationToken *RegistrationToken + resp, err := s.client.Do(ctx, req, ®istrationToken) if err != nil { return nil, resp, err } @@ -293,7 +293,7 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // ListOrganizationRunners lists all the self-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListRunnersOptions) (*Runners, *Response, error) { @@ -308,7 +308,7 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string return nil, nil, err } - runners := &Runners{} + var runners *Runners resp, err := s.client.Do(ctx, req, &runners) if err != nil { return nil, resp, err @@ -319,7 +319,7 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Runner, *Response, error) { @@ -329,8 +329,8 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, return nil, nil, err } - runner := new(Runner) - resp, err := s.client.Do(ctx, req, runner) + var runner *Runner + resp, err := s.client.Do(ctx, req, &runner) if err != nil { return nil, resp, err } @@ -340,7 +340,7 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, // CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-remove-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/remove-token func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org string) (*RemoveToken, *Response, error) { @@ -351,8 +351,8 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org return nil, nil, err } - removeToken := new(RemoveToken) - resp, err := s.client.Do(ctx, req, removeToken) + var removeToken *RemoveToken + resp, err := s.client.Do(ctx, req, &removeToken) if err != nil { return nil, resp, err } @@ -362,7 +362,7 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org // RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_secrets.go b/vendor/github.com/google/go-github/v85/github/actions_secrets.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/actions_secrets.go rename to vendor/github.com/google/go-github/v85/github/actions_secrets.go index f03d3fd19..5d80e5fe0 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v85/github/actions_secrets.go @@ -54,8 +54,8 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK return nil, nil, err } - pubKey := new(PublicKey) - resp, err := s.client.Do(ctx, req, pubKey) + var pubKey *PublicKey + resp, err := s.client.Do(ctx, req, &pubKey) if err != nil { return nil, resp, err } @@ -65,7 +65,7 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK // GetRepoPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-a-repository-public-key // //meta:operation GET /repos/{owner}/{repo}/actions/secrets/public-key func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { @@ -75,7 +75,7 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin // GetOrgPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-an-organization-public-key // //meta:operation GET /orgs/{org}/actions/secrets/public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { @@ -119,7 +119,7 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List return nil, nil, err } - secrets := new(Secrets) + var secrets *Secrets resp, err := s.client.Do(ctx, req, &secrets) if err != nil { return nil, resp, err @@ -131,7 +131,7 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List // ListRepoSecrets lists all secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-repository-secrets // //meta:operation GET /repos/{owner}/{repo}/actions/secrets func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -142,7 +142,7 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string // ListRepoOrgSecrets lists all organization secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-repository-organization-secrets // //meta:operation GET /repos/{owner}/{repo}/actions/organization-secrets func (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -153,7 +153,7 @@ func (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-organization-secrets // //meta:operation GET /orgs/{org}/actions/secrets func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { @@ -177,8 +177,8 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R return nil, nil, err } - secret := new(Secret) - resp, err := s.client.Do(ctx, req, secret) + var secret *Secret + resp, err := s.client.Do(ctx, req, &secret) if err != nil { return nil, resp, err } @@ -188,7 +188,7 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R // GetRepoSecret gets a single repository secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-a-repository-secret // //meta:operation GET /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { @@ -198,7 +198,7 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st // GetOrgSecret gets a single organization secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-an-organization-secret // //meta:operation GET /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { @@ -243,7 +243,7 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *Enc // CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret // //meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { @@ -257,7 +257,7 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { @@ -294,7 +294,7 @@ func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Respons // DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#delete-a-repository-secret // //meta:operation DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -304,7 +304,7 @@ func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name // DeleteOrgSecret deletes a secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#delete-an-organization-secret // //meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { @@ -339,8 +339,8 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str return nil, nil, err } - result := new(SelectedReposList) - resp, err := s.client.Do(ctx, req, result) + var result *SelectedReposList + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -350,7 +350,7 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str // ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret // //meta:operation GET /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -373,7 +373,7 @@ func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url stri // SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { @@ -392,7 +392,7 @@ func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string // AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -415,7 +415,7 @@ func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url s // RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret // //meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_variables.go b/vendor/github.com/google/go-github/v85/github/actions_variables.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/actions_variables.go rename to vendor/github.com/google/go-github/v85/github/actions_variables.go index b192ba703..1ec1f9305 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_variables.go +++ b/vendor/github.com/google/go-github/v85/github/actions_variables.go @@ -41,7 +41,7 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li return nil, nil, err } - variables := new(ActionsVariables) + var variables *ActionsVariables resp, err := s.client.Do(ctx, req, &variables) if err != nil { return nil, resp, err @@ -52,7 +52,7 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li // ListRepoVariables lists all variables available in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-repository-variables // //meta:operation GET /repos/{owner}/{repo}/actions/variables func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -62,7 +62,7 @@ func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo stri // ListRepoOrgVariables lists all organization variables available in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-organization-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-repository-organization-variables // //meta:operation GET /repos/{owner}/{repo}/actions/organization-variables func (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -72,7 +72,7 @@ func (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo s // ListOrgVariables lists all variables available in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-organization-variables // //meta:operation GET /orgs/{org}/actions/variables func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -82,7 +82,7 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // ListEnvVariables lists all variables available in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-environment-variables // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables func (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -96,8 +96,8 @@ func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsV return nil, nil, err } - variable := new(ActionsVariable) - resp, err := s.client.Do(ctx, req, variable) + var variable *ActionsVariable + resp, err := s.client.Do(ctx, req, &variable) if err != nil { return nil, resp, err } @@ -107,7 +107,7 @@ func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsV // GetRepoVariable gets a single repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-a-repository-variable // //meta:operation GET /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) { @@ -117,7 +117,7 @@ func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name // GetOrgVariable gets a single organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-an-organization-variable // //meta:operation GET /orgs/{org}/actions/variables/{name} func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) { @@ -127,7 +127,7 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // GetEnvVariable gets a single environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-an-environment-variable // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*ActionsVariable, *Response, error) { @@ -145,7 +145,7 @@ func (s *ActionsService) postVariable(ctx context.Context, url string, variable // CreateRepoVariable creates a repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable // //meta:operation POST /repos/{owner}/{repo}/actions/variables func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { @@ -155,7 +155,7 @@ func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo str // CreateOrgVariable creates an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable // //meta:operation POST /orgs/{org}/actions/variables func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { @@ -165,7 +165,7 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // CreateEnvVariable creates an environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable // //meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/variables func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { @@ -183,7 +183,7 @@ func (s *ActionsService) patchVariable(ctx context.Context, url string, variable // UpdateRepoVariable updates a repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable // //meta:operation PATCH /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { @@ -197,7 +197,7 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo str // UpdateOrgVariable updates an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-organization-variable // //meta:operation PATCH /orgs/{org}/actions/variables/{name} func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { @@ -211,7 +211,7 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // UpdateEnvVariable updates an environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable // //meta:operation PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { @@ -234,7 +234,7 @@ func (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Respo // DeleteRepoVariable deletes a variable in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-a-repository-variable // //meta:operation DELETE /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -244,7 +244,7 @@ func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, na // DeleteOrgVariable deletes a variable in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-an-organization-variable // //meta:operation DELETE /orgs/{org}/actions/variables/{name} func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) { @@ -254,7 +254,7 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // DeleteEnvVariable deletes a variable in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-an-environment-variable // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} func (s *ActionsService) DeleteEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*Response, error) { @@ -273,8 +273,8 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s return nil, nil, err } - result := new(SelectedReposList) - resp, err := s.client.Do(ctx, req, result) + var result *SelectedReposList + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -284,7 +284,7 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s // ListSelectedReposForOrgVariable lists all repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-variable // //meta:operation GET /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -307,7 +307,7 @@ func (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url st // SetSelectedReposForOrgVariable sets the repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-variable // //meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { @@ -326,7 +326,7 @@ func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url stri // AddSelectedRepoToOrgVariable adds a repository to an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#add-selected-repository-to-an-organization-variable // //meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -352,7 +352,7 @@ func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url // RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-variable // //meta:operation DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v85/github/actions_workflow_jobs.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v85/github/actions_workflow_jobs.go index dabc80917..ba000331d 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_workflow_jobs.go +++ b/vendor/github.com/google/go-github/v85/github/actions_workflow_jobs.go @@ -70,7 +70,7 @@ type ListWorkflowJobsOptions struct { // ListWorkflowJobs lists all jobs for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { @@ -85,7 +85,7 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin return nil, nil, err } - jobs := new(Jobs) + var jobs *Jobs resp, err := s.client.Do(ctx, req, &jobs) if err != nil { return nil, resp, err @@ -96,7 +96,7 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin // ListWorkflowJobsAttempt lists jobs for a workflow run Attempt. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run-attempt // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, repo string, runID, attemptNumber int64, opts *ListOptions) (*Jobs, *Response, error) { @@ -111,7 +111,7 @@ func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, rep return nil, nil, err } - jobs := new(Jobs) + var jobs *Jobs resp, err := s.client.Do(ctx, req, &jobs) if err != nil { return nil, resp, err @@ -122,7 +122,7 @@ func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, rep // GetWorkflowJobByID gets a specific job in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#get-a-job-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id} func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { @@ -133,8 +133,8 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str return nil, nil, err } - job := new(WorkflowJob) - resp, err := s.client.Do(ctx, req, job) + var job *WorkflowJob + resp, err := s.client.Do(ctx, req, &job) if err != nil { return nil, resp, err } @@ -144,7 +144,7 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#download-job-logs-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v85/github/actions_workflow_runs.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v85/github/actions_workflow_runs.go index 7b13a23ef..117346694 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v85/github/actions_workflow_runs.go @@ -149,7 +149,7 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, return nil, nil, err } - runs := new(WorkflowRuns) + var runs *WorkflowRuns resp, err := s.client.Do(ctx, req, &runs) if err != nil { return nil, resp, err @@ -160,7 +160,7 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -170,7 +170,7 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -180,7 +180,7 @@ func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, // ListRepositoryWorkflowRuns lists all workflow runs for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runs func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -195,7 +195,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, return nil, nil, err } - runs := new(WorkflowRuns) + var runs *WorkflowRuns resp, err := s.client.Do(ctx, req, &runs) if err != nil { return nil, resp, err @@ -207,7 +207,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, // GetWorkflowRunByID gets a specific workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id} func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { @@ -218,8 +218,8 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str return nil, nil, err } - run := new(WorkflowRun) - resp, err := s.client.Do(ctx, req, run) + var run *WorkflowRun + resp, err := s.client.Do(ctx, req, &run) if err != nil { return nil, resp, err } @@ -230,7 +230,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str // GetWorkflowRunAttempt gets a specific workflow run attempt. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run-attempt // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) { @@ -245,8 +245,8 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo return nil, nil, err } - run := new(WorkflowRun) - resp, err := s.client.Do(ctx, req, run) + var run *WorkflowRun + resp, err := s.client.Do(ctx, req, &run) if err != nil { return nil, resp, err } @@ -257,7 +257,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve a workflow run ID from the DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#download-workflow-run-attempt-logs // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber, maxRedirects int) (*url.URL, *Response, error) { @@ -308,7 +308,7 @@ func (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Cont // RerunWorkflowByID re-runs a workflow by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID of a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-workflow // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { @@ -325,7 +325,7 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-failed-jobs-from-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { @@ -343,7 +343,7 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) { @@ -360,7 +360,7 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j // CancelWorkflowRunByID cancels a workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { @@ -377,7 +377,7 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#download-workflow-run-logs // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) { @@ -428,7 +428,7 @@ func (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u // DeleteWorkflowRun deletes a workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#delete-a-workflow-run // //meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id} func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) { @@ -445,7 +445,7 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri // DeleteWorkflowRunLogs deletes all logs for a workflow run. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#delete-workflow-run-logs // //meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) { @@ -462,7 +462,7 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-workflow-run-usage // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) { @@ -473,8 +473,8 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep return nil, nil, err } - workflowRunUsage := new(WorkflowRunUsage) - resp, err := s.client.Do(ctx, req, workflowRunUsage) + var workflowRunUsage *WorkflowRunUsage + resp, err := s.client.Do(ctx, req, &workflowRunUsage) if err != nil { return nil, resp, err } @@ -485,7 +485,7 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep // GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-pending-deployments-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo string, runID int64) ([]*PendingDeployment, *Response, error) { @@ -508,7 +508,7 @@ func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#review-pending-deployments-for-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) { @@ -531,7 +531,7 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str // ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#review-custom-deployment-protection-rules-for-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule func (s *ActionsService) ReviewCustomDeploymentProtectionRule(ctx context.Context, owner, repo string, runID int64, request *ReviewCustomDeploymentProtectionRuleRequest) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/actions_workflows.go b/vendor/github.com/google/go-github/v85/github/actions_workflows.go similarity index 85% rename from vendor/github.com/google/go-github/v82/github/actions_workflows.go rename to vendor/github.com/google/go-github/v85/github/actions_workflows.go index e0bcde351..6d5c93883 100644 --- a/vendor/github.com/google/go-github/v82/github/actions_workflows.go +++ b/vendor/github.com/google/go-github/v85/github/actions_workflows.go @@ -51,9 +51,20 @@ type CreateWorkflowDispatchEventRequest struct { // Ref is required when creating a workflow dispatch event. Ref string `json:"ref"` // Inputs represents input keys and values configured in the workflow file. - // The maximum number of properties is 10. + // The maximum number of properties is 25. // Default: Any default properties configured in the workflow file will be used when `inputs` are omitted. Inputs map[string]any `json:"inputs,omitempty"` + // ReturnRunDetails specifies whether the response should include + // the workflow run ID and URLs. + ReturnRunDetails *bool `json:"return_run_details,omitempty"` +} + +// WorkflowDispatchRunDetails represents the response from creating +// a workflow dispatch event when ReturnRunDetails is set to true. +type WorkflowDispatchRunDetails struct { + WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` + RunURL *string `json:"run_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` } // WorkflowsPermissions represents the permissions for workflows in a repository. @@ -88,7 +99,7 @@ func (p ContributorApprovalPermissions) String() string { // ListWorkflows lists all workflows in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#list-repository-workflows +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows // //meta:operation GET /repos/{owner}/{repo}/actions/workflows func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) { @@ -103,7 +114,7 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, return nil, nil, err } - workflows := new(Workflows) + var workflows *Workflows resp, err := s.client.Do(ctx, req, &workflows) if err != nil { return nil, resp, err @@ -114,7 +125,7 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, // GetWorkflowByID gets a specific workflow by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) { @@ -125,7 +136,7 @@ func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string // GetWorkflowByFileName gets a specific workflow by file name. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) { @@ -140,8 +151,8 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow return nil, nil, err } - workflow := new(Workflow) - resp, err := s.client.Do(ctx, req, workflow) + var workflow *Workflow + resp, err := s.client.Do(ctx, req, &workflow) if err != nil { return nil, resp, err } @@ -151,7 +162,7 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow // GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-workflow-usage // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) { @@ -162,7 +173,7 @@ func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo s // GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-workflow-usage // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) { @@ -177,8 +188,8 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor return nil, nil, err } - workflowUsage := new(WorkflowUsage) - resp, err := s.client.Do(ctx, req, workflowUsage) + var workflowUsage *WorkflowUsage + resp, err := s.client.Do(ctx, req, &workflowUsage) if err != nil { return nil, resp, err } @@ -188,10 +199,10 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event // //meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches -func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error) { +func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) return s.createWorkflowDispatchEvent(ctx, u, &event) @@ -199,27 +210,33 @@ func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, ow // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event // //meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches -func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error) { +func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) return s.createWorkflowDispatchEvent(ctx, u, &event) } -func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url string, event *CreateWorkflowDispatchEventRequest) (*Response, error) { +func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url string, event *CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) { req, err := s.client.NewRequest("POST", url, event) if err != nil { - return nil, err + return nil, nil, err } - return s.client.Do(ctx, req, nil) + var dispatchRunDetails *WorkflowDispatchRunDetails + resp, err := s.client.Do(ctx, req, &dispatchRunDetails) + if err != nil { + return nil, resp, err + } + + return dispatchRunDetails, resp, nil } // EnableWorkflowByID enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { @@ -229,7 +246,7 @@ func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo str // EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { @@ -239,7 +256,7 @@ func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, re // DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#disable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { @@ -249,7 +266,7 @@ func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo st // DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#disable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/activity.go b/vendor/github.com/google/go-github/v85/github/activity.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/activity.go rename to vendor/github.com/google/go-github/v85/github/activity.go index edf8cc439..15e9fb8d4 100644 --- a/vendor/github.com/google/go-github/v82/github/activity.go +++ b/vendor/github.com/google/go-github/v85/github/activity.go @@ -10,7 +10,7 @@ import "context" // ActivityService handles communication with the activity related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/activity/ +// GitHub API docs: https://docs.github.com/rest/activity?apiVersion=2022-11-28 type ActivityService service // FeedLink represents a link to a related resource. @@ -58,7 +58,7 @@ type FeedLinks struct { // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. // -// GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds +// GitHub API docs: https://docs.github.com/rest/activity/feeds?apiVersion=2022-11-28#get-feeds // //meta:operation GET /feeds func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) { @@ -67,8 +67,8 @@ func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, err return nil, nil, err } - f := &Feeds{} - resp, err := s.client.Do(ctx, req, f) + var f *Feeds + resp, err := s.client.Do(ctx, req, &f) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/activity_events.go b/vendor/github.com/google/go-github/v85/github/activity_events.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/activity_events.go rename to vendor/github.com/google/go-github/v85/github/activity_events.go index 597f79920..3c37b8967 100644 --- a/vendor/github.com/google/go-github/v82/github/activity_events.go +++ b/vendor/github.com/google/go-github/v85/github/activity_events.go @@ -12,7 +12,7 @@ import ( // ListEvents drinks from the firehose of all public events across GitHub. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events // //meta:operation GET /events func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { @@ -37,7 +37,7 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] // ListRepositoryEvents lists events for a repository. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-repository-events +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-repository-events // //meta:operation GET /repos/{owner}/{repo}/events func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { @@ -63,7 +63,7 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#list-issue-events-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/issues/events func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { @@ -89,7 +89,7 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne // ListEventsForRepoNetwork lists public events for a network of repositories. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-network-of-repositories // //meta:operation GET /networks/{owner}/{repo}/events func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { @@ -115,7 +115,7 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-organization-events +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-organization-events // //meta:operation GET /orgs/{org}/events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { @@ -142,9 +142,9 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // ListEventsPerformedByUser lists the events performed by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-events-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-user // //meta:operation GET /users/{username}/events //meta:operation GET /users/{username}/events/public @@ -177,9 +177,9 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-events-received-by-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-received-by-a-user // //meta:operation GET /users/{username}/received_events //meta:operation GET /users/{username}/received_events/public @@ -212,7 +212,7 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-organization-events-for-the-authenticated-user // //meta:operation GET /users/{username}/events/orgs/{org} func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/activity_notifications.go b/vendor/github.com/google/go-github/v85/github/activity_notifications.go similarity index 85% rename from vendor/github.com/google/go-github/v82/github/activity_notifications.go rename to vendor/github.com/google/go-github/v85/github/activity_notifications.go index e712323ed..8442dbe1b 100644 --- a/vendor/github.com/google/go-github/v82/github/activity_notifications.go +++ b/vendor/github.com/google/go-github/v85/github/activity_notifications.go @@ -19,7 +19,7 @@ type Notification struct { // Reason identifies the event that triggered the notification. // - // GitHub API docs: https://docs.github.com/rest/activity#notification-reasons + // GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#notification-reasons Reason *string `json:"reason,omitempty"` Unread *bool `json:"unread,omitempty"` @@ -49,7 +49,7 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#list-notifications-for-the-authenticated-user // //meta:operation GET /notifications func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { @@ -76,7 +76,7 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#list-repository-notifications-for-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/notifications func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { @@ -101,12 +101,13 @@ func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner } type markReadOptions struct { - LastReadAt Timestamp `json:"last_read_at,omitempty"` + LastReadAt Timestamp `json:"last_read_at,omitzero"` } // MarkNotificationsRead marks all notifications up to lastRead as read. +// If lastRead is the zero value, all notifications in the repository are marked as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-notifications-as-read // //meta:operation PUT /notifications func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { @@ -123,8 +124,9 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Ti // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. +// If lastRead is the zero value, all notifications in the repository are marked as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-repository-notifications-as-read // //meta:operation PUT /repos/{owner}/{repo}/notifications func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) { @@ -142,7 +144,7 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o // GetThread gets the specified notification thread. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#get-a-thread // //meta:operation GET /notifications/threads/{thread_id} func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { @@ -153,8 +155,8 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati return nil, nil, err } - notification := new(Notification) - resp, err := s.client.Do(ctx, req, notification) + var notification *Notification + resp, err := s.client.Do(ctx, req, ¬ification) if err != nil { return nil, resp, err } @@ -164,7 +166,7 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati // MarkThreadRead marks the specified thread as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-read // //meta:operation PATCH /notifications/threads/{thread_id} func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) { @@ -181,10 +183,10 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo // MarkThreadDone marks the specified thread as done. // Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done // //meta:operation DELETE /notifications/threads/{thread_id} -func (s *ActivityService) MarkThreadDone(ctx context.Context, id int64) (*Response, error) { +func (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -198,7 +200,7 @@ func (s *ActivityService) MarkThreadDone(ctx context.Context, id int64) (*Respon // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#get-a-thread-subscription-for-the-authenticated-user // //meta:operation GET /notifications/threads/{thread_id}/subscription func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { @@ -209,8 +211,8 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(ctx, req, &sub) if err != nil { return nil, resp, err } @@ -221,7 +223,7 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) // SetThreadSubscription sets the subscription for the specified thread for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#set-a-thread-subscription // //meta:operation PUT /notifications/threads/{thread_id}/subscription func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) { @@ -232,8 +234,8 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(ctx, req, &sub) if err != nil { return nil, resp, err } @@ -244,7 +246,7 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, // DeleteThreadSubscription deletes the subscription for the specified thread // for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#delete-a-thread-subscription // //meta:operation DELETE /notifications/threads/{thread_id}/subscription func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/activity_star.go b/vendor/github.com/google/go-github/v85/github/activity_star.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/activity_star.go rename to vendor/github.com/google/go-github/v85/github/activity_star.go index d9383e434..cdc491a7c 100644 --- a/vendor/github.com/google/go-github/v82/github/activity_star.go +++ b/vendor/github.com/google/go-github/v85/github/activity_star.go @@ -25,7 +25,7 @@ type Stargazer struct { // ListStargazers lists people who have starred the specified repo. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-stargazers +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-stargazers // //meta:operation GET /repos/{owner}/{repo}/stargazers func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) { @@ -68,9 +68,9 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-repositories-starred-by-a-user // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-repositories-starred-by-the-authenticated-user // //meta:operation GET /user/starred //meta:operation GET /users/{username}/starred @@ -105,7 +105,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#check-if-a-repository-is-starred-by-the-authenticated-user // //meta:operation GET /user/starred/{owner}/{repo} func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { @@ -122,7 +122,7 @@ func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bo // Star a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#star-a-repository-for-the-authenticated-user // //meta:operation PUT /user/starred/{owner}/{repo} func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { @@ -137,7 +137,7 @@ func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Respon // Unstar a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#unstar-a-repository-for-the-authenticated-user // //meta:operation DELETE /user/starred/{owner}/{repo} func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/activity_watching.go b/vendor/github.com/google/go-github/v85/github/activity_watching.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/activity_watching.go rename to vendor/github.com/google/go-github/v85/github/activity_watching.go index 8106d799c..1f16e8027 100644 --- a/vendor/github.com/google/go-github/v82/github/activity_watching.go +++ b/vendor/github.com/google/go-github/v85/github/activity_watching.go @@ -27,7 +27,7 @@ type Subscription struct { // ListWatchers lists watchers of a particular repo. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-watchers +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-watchers // //meta:operation GET /repos/{owner}/{repo}/subscribers func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { @@ -54,9 +54,9 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-repositories-watched-by-a-user // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-repositories-watched-by-the-authenticated-user // //meta:operation GET /user/subscriptions //meta:operation GET /users/{username}/subscriptions @@ -90,7 +90,7 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li // repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#get-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#get-a-repository-subscription // //meta:operation GET /repos/{owner}/{repo}/subscription func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) { @@ -101,8 +101,8 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(ctx, req, &sub) if err != nil { // if it's just a 404, don't return that as an error _, err = parseBoolResponse(err) @@ -119,7 +119,7 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, // To ignore notifications made within a repository, set subscription.Ignored to true. // To stop watching a repository, use DeleteRepositorySubscription. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#set-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#set-a-repository-subscription // //meta:operation PUT /repos/{owner}/{repo}/subscription func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) { @@ -130,8 +130,8 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(ctx, req, &sub) if err != nil { return nil, resp, err } @@ -145,7 +145,7 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, // This is used to stop watching a repository. To control whether or not to // receive notifications from a repository, use SetRepositorySubscription. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#delete-a-repository-subscription // //meta:operation DELETE /repos/{owner}/{repo}/subscription func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/admin.go b/vendor/github.com/google/go-github/v85/github/admin.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/admin.go rename to vendor/github.com/google/go-github/v85/github/admin.go index ce1ecb031..c993c47fa 100644 --- a/vendor/github.com/google/go-github/v82/github/admin.go +++ b/vendor/github.com/google/go-github/v85/github/admin.go @@ -14,7 +14,7 @@ import ( // GitHub API. These API routes are normally only accessible for GitHub // Enterprise installations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin +// GitHub API docs: https://docs.github.com/rest/enterprise-admin?apiVersion=2022-11-28 type AdminService service // TeamLDAPMapping represents the mapping between a GitHub team and an LDAP group. @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -92,8 +92,8 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m return nil, nil, err } - m := new(UserLDAPMapping) - resp, err := s.client.Do(ctx, req, m) + var m *UserLDAPMapping + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { @@ -113,8 +113,8 @@ func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, ma return nil, nil, err } - m := new(TeamLDAPMapping) - resp, err := s.client.Do(ctx, req, m) + var m *TeamLDAPMapping + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/admin_orgs.go b/vendor/github.com/google/go-github/v85/github/admin_orgs.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/admin_orgs.go rename to vendor/github.com/google/go-github/v85/github/admin_orgs.go index 03fa77832..2e24b2a10 100644 --- a/vendor/github.com/google/go-github/v82/github/admin_orgs.go +++ b/vendor/github.com/google/go-github/v85/github/admin_orgs.go @@ -23,7 +23,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -39,8 +39,8 @@ func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin s return nil, nil, err } - o := new(Organization) - resp, err := s.client.Do(ctx, req, o) + var o *Organization + resp, err := s.client.Do(ctx, req, &o) if err != nil { return nil, resp, err } @@ -62,7 +62,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -78,7 +78,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { @@ -93,8 +93,8 @@ func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) return nil, nil, err } - o := new(RenameOrgResponse) - resp, err := s.client.Do(ctx, req, o) + var o *RenameOrgResponse + resp, err := s.client.Do(ctx, req, &o) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/admin_stats.go b/vendor/github.com/google/go-github/v85/github/admin_stats.go similarity index 97% rename from vendor/github.com/google/go-github/v82/github/admin_stats.go rename to vendor/github.com/google/go-github/v85/github/admin_stats.go index 6e6e4f279..51f047026 100644 --- a/vendor/github.com/google/go-github/v82/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v85/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { @@ -162,8 +162,8 @@ func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Respons return nil, nil, err } - m := new(AdminStats) - resp, err := s.client.Do(ctx, req, m) + var m *AdminStats + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/admin_users.go b/vendor/github.com/google/go-github/v85/github/admin_users.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/admin_users.go rename to vendor/github.com/google/go-github/v85/github/admin_users.go index dc3428df9..f9af3611e 100644 --- a/vendor/github.com/google/go-github/v82/github/admin_users.go +++ b/vendor/github.com/google/go-github/v85/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -106,8 +106,8 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str return nil, nil, err } - a := new(UserAuthorization) - resp, err := s.client.Do(ctx, req, a) + var a *UserAuthorization + resp, err := s.client.Do(ctx, req, &a) if err != nil { return nil, resp, err } @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/apps.go b/vendor/github.com/google/go-github/v85/github/apps.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/apps.go rename to vendor/github.com/google/go-github/v85/github/apps.go index fe36b9584..f9e8f4f33 100644 --- a/vendor/github.com/google/go-github/v82/github/apps.go +++ b/vendor/github.com/google/go-github/v85/github/apps.go @@ -13,13 +13,14 @@ import ( // AppsService provides access to the installation related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/apps/ +// GitHub API docs: https://docs.github.com/rest/apps?apiVersion=2022-11-28 type AppsService service // App represents a GitHub App. type App struct { ID *int64 `json:"id,omitempty"` Slug *string `json:"slug,omitempty"` + ClientID *string `json:"client_id,omitempty"` NodeID *string `json:"node_id,omitempty"` Owner *User `json:"owner,omitempty"` Name *string `json:"name,omitempty"` @@ -77,7 +78,7 @@ type InstallationTokenListRepoOptions struct { // Permission names taken from: // // https://docs.github.com/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app -// https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/rest/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` ActionsVariables *string `json:"actions_variables,omitempty"` @@ -115,6 +116,7 @@ type InstallationPermissions struct { OrganizationCodespaces *string `json:"organization_codespaces,omitempty"` OrganizationCodespacesSecrets *string `json:"organization_codespaces_secrets,omitempty"` OrganizationCodespacesSettings *string `json:"organization_codespaces_settings,omitempty"` + OrganizationCopilotMetrics *string `json:"organization_copilot_metrics,omitempty"` OrganizationCopilotSeatManagement *string `json:"organization_copilot_seat_management,omitempty"` OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` @@ -214,9 +216,9 @@ func (i Installation) String() string { // You can find this on the settings page for your GitHub App // (e.g., https://github.com/settings/apps/:app_slug). // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-app // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-the-authenticated-app // //meta:operation GET /app //meta:operation GET /apps/{app_slug} @@ -233,8 +235,8 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, return nil, nil, err } - app := new(App) - resp, err := s.client.Do(ctx, req, app) + var app *App + resp, err := s.client.Do(ctx, req, &app) if err != nil { return nil, resp, err } @@ -244,7 +246,7 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, // ListInstallationRequests lists the pending installation requests that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#list-installation-requests-for-the-authenticated-app // //meta:operation GET /app/installation-requests func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOptions) ([]*InstallationRequest, *Response, error) { @@ -269,7 +271,7 @@ func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOp // ListInstallations lists the installations that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#list-installations-for-the-authenticated-app // //meta:operation GET /app/installations func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { @@ -294,7 +296,7 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-installation-for-the-authenticated-app // //meta:operation GET /app/installations/{installation_id} func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { @@ -303,7 +305,7 @@ func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installat // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-app-installations-accessible-to-the-user-access-token // //meta:operation GET /user/installations func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { @@ -330,7 +332,7 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio // SuspendInstallation suspends the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#suspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#suspend-an-app-installation // //meta:operation PUT /app/installations/{installation_id}/suspended func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) { @@ -346,7 +348,7 @@ func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Respo // UnsuspendInstallation unsuspends the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#unsuspend-an-app-installation // //meta:operation DELETE /app/installations/{installation_id}/suspended func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) { @@ -362,7 +364,7 @@ func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Res // DeleteInstallation deletes the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#delete-an-installation-for-the-authenticated-app // //meta:operation DELETE /app/installations/{installation_id} func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) { @@ -378,7 +380,7 @@ func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Respon // CreateInstallationToken creates a new installation token. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app // //meta:operation POST /app/installations/{installation_id}/access_tokens func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) { @@ -389,8 +391,8 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt return nil, nil, err } - t := new(InstallationToken) - resp, err := s.client.Do(ctx, req, t) + var t *InstallationToken + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -402,7 +404,7 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // // It differs from CreateInstallationToken by taking InstallationTokenListRepoOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app // //meta:operation POST /app/installations/{installation_id}/access_tokens func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id int64, opts *InstallationTokenListRepoOptions) (*InstallationToken, *Response, error) { @@ -413,8 +415,8 @@ func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id i return nil, nil, err } - t := new(InstallationToken) - resp, err := s.client.Do(ctx, req, t) + var t *InstallationToken + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -429,7 +431,7 @@ func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id i //meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) - payload := &Attachment{Title: Ptr(title), Body: Ptr(body)} + payload := &Attachment{Title: &title, Body: &body} req, err := s.client.NewRequest("POST", u, payload) if err != nil { return nil, nil, err @@ -437,8 +439,8 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i req.Header.Set("Accept", mediaTypeContentAttachmentsPreview) - m := &Attachment{} - resp, err := s.client.Do(ctx, req, m) + var m *Attachment + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -448,7 +450,7 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i // FindOrganizationInstallation finds the organization's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-organization-installation-for-the-authenticated-app // //meta:operation GET /orgs/{org}/installation func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { @@ -457,7 +459,7 @@ func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org stri // FindRepositoryInstallation finds the repository's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app // //meta:operation GET /repos/{owner}/{repo}/installation func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { @@ -475,7 +477,7 @@ func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int // FindUserInstallation finds the user's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app // //meta:operation GET /users/{username}/installation func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { @@ -488,8 +490,8 @@ func (s *AppsService) getInstallation(ctx context.Context, url string) (*Install return nil, nil, err } - i := new(Installation) - resp, err := s.client.Do(ctx, req, i) + var i *Installation + resp, err := s.client.Do(ctx, req, &i) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/apps_hooks.go b/vendor/github.com/google/go-github/v85/github/apps_hooks.go similarity index 77% rename from vendor/github.com/google/go-github/v82/github/apps_hooks.go rename to vendor/github.com/google/go-github/v85/github/apps_hooks.go index 6046827ef..22caab097 100644 --- a/vendor/github.com/google/go-github/v82/github/apps_hooks.go +++ b/vendor/github.com/google/go-github/v85/github/apps_hooks.go @@ -12,7 +12,7 @@ import ( // GetHookConfig returns the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-app // //meta:operation GET /app/hook/config func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { @@ -21,7 +21,7 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response return nil, nil, err } - config := new(HookConfig) + var config *HookConfig resp, err := s.client.Do(ctx, req, &config) if err != nil { return nil, resp, err @@ -33,7 +33,7 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // UpdateHookConfig updates the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-app // //meta:operation PATCH /app/hook/config func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { @@ -42,8 +42,8 @@ func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) return nil, nil, err } - c := new(HookConfig) - resp, err := s.client.Do(ctx, req, c) + var c *HookConfig + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v85/github/apps_hooks_deliveries.go similarity index 78% rename from vendor/github.com/google/go-github/v82/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v85/github/apps_hooks_deliveries.go index 59800a0ae..cd7c847de 100644 --- a/vendor/github.com/google/go-github/v82/github/apps_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v85/github/apps_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists deliveries of an App webhook. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#list-deliveries-for-an-app-webhook // //meta:operation GET /app/hook/deliveries func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { @@ -37,7 +37,7 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp // GetHookDelivery returns the App webhook delivery with the specified ID. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#get-a-delivery-for-an-app-webhook // //meta:operation GET /app/hook/deliveries/{delivery_id} func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { @@ -47,8 +47,8 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -58,7 +58,7 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H // RedeliverHookDelivery redelivers a delivery for an App webhook. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#redeliver-a-delivery-for-an-app-webhook // //meta:operation POST /app/hook/deliveries/{delivery_id}/attempts func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { @@ -68,8 +68,8 @@ func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int6 return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/apps_installation.go b/vendor/github.com/google/go-github/v85/github/apps_installation.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/apps_installation.go rename to vendor/github.com/google/go-github/v85/github/apps_installation.go index 57d6b4e76..2fec33a67 100644 --- a/vendor/github.com/google/go-github/v82/github/apps_installation.go +++ b/vendor/github.com/google/go-github/v85/github/apps_installation.go @@ -18,7 +18,7 @@ type ListRepositories struct { // ListRepos lists the repositories that are accessible to the authenticated installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-app-installation // //meta:operation GET /installation/repositories func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -33,7 +33,6 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe } var r *ListRepositories - resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err @@ -45,7 +44,7 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe // ListUserRepos lists repositories that are accessible // to the authenticated user for an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-user-access-token // //meta:operation GET /user/installations/{installation_id}/repositories func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -71,7 +70,7 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt // AddRepository adds a single repository to an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#add-a-repository-to-an-app-installation // //meta:operation PUT /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { @@ -81,8 +80,8 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( return nil, nil, err } - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -92,7 +91,7 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#remove-a-repository-from-an-app-installation // //meta:operation DELETE /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { @@ -107,7 +106,7 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 // RevokeInstallationToken revokes an installation token. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#revoke-an-installation-access-token // //meta:operation DELETE /installation/token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/apps_manifest.go b/vendor/github.com/google/go-github/v85/github/apps_manifest.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/apps_manifest.go rename to vendor/github.com/google/go-github/v85/github/apps_manifest.go index fdd8d7b1e..4ac948845 100644 --- a/vendor/github.com/google/go-github/v82/github/apps_manifest.go +++ b/vendor/github.com/google/go-github/v85/github/apps_manifest.go @@ -31,7 +31,7 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-a-github-app-from-a-manifest // //meta:operation POST /app-manifests/{code}/conversions func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { @@ -41,8 +41,8 @@ func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*Ap return nil, nil, err } - cfg := new(AppConfig) - resp, err := s.client.Do(ctx, req, cfg) + var cfg *AppConfig + resp, err := s.client.Do(ctx, req, &cfg) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/apps_marketplace.go b/vendor/github.com/google/go-github/v85/github/apps_marketplace.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v85/github/apps_marketplace.go index 33382378e..1594e73eb 100644 --- a/vendor/github.com/google/go-github/v82/github/apps_marketplace.go +++ b/vendor/github.com/google/go-github/v85/github/apps_marketplace.go @@ -13,7 +13,7 @@ import ( // MarketplaceService handles communication with the marketplace related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/apps#marketplace +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28 type MarketplaceService struct { client *Client // Stubbed controls whether endpoints that return stubbed data are used @@ -21,7 +21,7 @@ type MarketplaceService struct { // for testing your GitHub Apps. Stubbed data is hard-coded and will not // change based on actual subscriptions. // - // GitHub API docs: https://docs.github.com/rest/apps#testing-with-stubbed-endpoints + // GitHub API docs: https://docs.github.com/rest/apps?apiVersion=2022-11-28#testing-with-stubbed-endpoints Stubbed bool } @@ -89,9 +89,9 @@ type MarketplacePurchaseAccount struct { // ListPlans lists all plans for your Marketplace listing. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-plans // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-plans-stubbed // //meta:operation GET /marketplace_listing/plans //meta:operation GET /marketplace_listing/stubbed/plans @@ -118,9 +118,9 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-accounts-for-a-plan // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-accounts-for-a-plan-stubbed // //meta:operation GET /marketplace_listing/plans/{plan_id}/accounts //meta:operation GET /marketplace_listing/stubbed/plans/{plan_id}/accounts @@ -147,9 +147,9 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // GetPlanAccountForAccount get GitHub account (user or organization) associated with an account. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#get-a-subscription-plan-for-an-account // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#get-a-subscription-plan-for-an-account-stubbed // //meta:operation GET /marketplace_listing/accounts/{account_id} //meta:operation GET /marketplace_listing/stubbed/accounts/{account_id} @@ -172,9 +172,9 @@ func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accou // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-subscriptions-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-subscriptions-for-the-authenticated-user-stubbed // //meta:operation GET /user/marketplace_purchases //meta:operation GET /user/marketplace_purchases/stubbed diff --git a/vendor/github.com/google/go-github/v82/github/attestations.go b/vendor/github.com/google/go-github/v85/github/attestations.go similarity index 100% rename from vendor/github.com/google/go-github/v82/github/attestations.go rename to vendor/github.com/google/go-github/v85/github/attestations.go diff --git a/vendor/github.com/google/go-github/v82/github/authorizations.go b/vendor/github.com/google/go-github/v85/github/authorizations.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/authorizations.go rename to vendor/github.com/google/go-github/v85/github/authorizations.go index 612276c1e..f83acd331 100644 --- a/vendor/github.com/google/go-github/v82/github/authorizations.go +++ b/vendor/github.com/google/go-github/v85/github/authorizations.go @@ -50,7 +50,7 @@ const ( // This service requires HTTP Basic Authentication; it cannot be accessed using // an OAuth token. // -// GitHub API docs: https://docs.github.com/rest/oauth-authorizations +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations?apiVersion=2022-11-28 type AuthorizationsService service // Authorization represents an individual GitHub authorization. @@ -121,7 +121,7 @@ func (a AuthorizationRequest) String() string { // fields. That is, you may provide only one of "Scopes", or "AddScopes", or // "RemoveScopes". // -// GitHub API docs: https://docs.github.com/rest/oauth-authorizations#update-an-existing-authorization +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations?apiVersion=2022-11-28#update-an-existing-authorization type AuthorizationUpdateRequest struct { Scopes []string `json:"scopes,omitempty"` AddScopes []string `json:"add_scopes,omitempty"` @@ -143,7 +143,7 @@ func (a AuthorizationUpdateRequest) String() string { // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#check-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#check-a-token // //meta:operation POST /applications/{client_id}/token func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { @@ -159,8 +159,8 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken } req.Header.Set("Accept", mediaTypeOAuthAppPreview) - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) + var a *Authorization + resp, err := s.client.Do(ctx, req, &a) if err != nil { return nil, resp, err } @@ -178,7 +178,7 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#reset-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#reset-a-token // //meta:operation PATCH /applications/{client_id}/token func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { @@ -194,8 +194,8 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken } req.Header.Set("Accept", mediaTypeOAuthAppPreview) - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) + var a *Authorization + resp, err := s.client.Do(ctx, req, &a) if err != nil { return nil, resp, err } @@ -209,7 +209,7 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#delete-an-app-token // //meta:operation DELETE /applications/{client_id}/token func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { @@ -232,7 +232,7 @@ func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToke // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#delete-an-app-authorization // //meta:operation DELETE /applications/{client_id}/grant func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -267,8 +267,8 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam return nil, nil, err } - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) + var a *Authorization + resp, err := s.client.Do(ctx, req, &a) if err != nil { return nil, resp, err } @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/billing.go b/vendor/github.com/google/go-github/v85/github/billing.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/billing.go rename to vendor/github.com/google/go-github/v85/github/billing.go index bbe7cebfa..bb9ad1937 100644 --- a/vendor/github.com/google/go-github/v82/github/billing.go +++ b/vendor/github.com/google/go-github/v85/github/billing.go @@ -13,7 +13,7 @@ import ( // BillingService provides access to the billing related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/billing +// GitHub API docs: https://docs.github.com/rest/billing?apiVersion=2022-11-28 type BillingService service // MinutesUsedBreakdown counts the actions minutes used by machine type (e.g. UBUNTU, WINDOWS, MACOS). @@ -144,11 +144,11 @@ type PremiumRequestUsageItem struct { Model string `json:"model"` UnitType string `json:"unitType"` PricePerUnit float64 `json:"pricePerUnit"` - GrossQuantity int `json:"grossQuantity"` + GrossQuantity float64 `json:"grossQuantity"` GrossAmount float64 `json:"grossAmount"` - DiscountQuantity int `json:"discountQuantity"` + DiscountQuantity float64 `json:"discountQuantity"` DiscountAmount float64 `json:"discountAmount"` - NetQuantity int `json:"netQuantity"` + NetQuantity float64 `json:"netQuantity"` NetAmount float64 `json:"netAmount"` } @@ -182,8 +182,8 @@ func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org return nil, nil, err } - result := new(PackagesBilling) - resp, err := s.client.Do(ctx, req, result) + var result *PackagesBilling + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -203,8 +203,8 @@ func (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org return nil, nil, err } - result := new(StorageBilling) - resp, err := s.client.Do(ctx, req, result) + var result *StorageBilling + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -214,7 +214,7 @@ func (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org // GetOrganizationAdvancedSecurityActiveCommitters returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization // //meta:operation GET /orgs/{org}/settings/billing/advanced-security func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx context.Context, org string, opts *ActiveCommittersListOptions) (*ActiveCommitters, *Response, error) { @@ -229,8 +229,8 @@ func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx con return nil, nil, err } - result := new(ActiveCommitters) - resp, err := s.client.Do(ctx, req, result) + var result *ActiveCommitters + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -249,8 +249,8 @@ func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (* return nil, nil, err } - packagesUserBilling := new(PackagesBilling) - resp, err := s.client.Do(ctx, req, packagesUserBilling) + var packagesUserBilling *PackagesBilling + resp, err := s.client.Do(ctx, req, &packagesUserBilling) if err != nil { return nil, resp, err } @@ -270,8 +270,8 @@ func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*S return nil, nil, err } - storageUserBilling := new(StorageBilling) - resp, err := s.client.Do(ctx, req, storageUserBilling) + var storageUserBilling *StorageBilling + resp, err := s.client.Do(ctx, req, &storageUserBilling) if err != nil { return nil, resp, err } @@ -283,7 +283,7 @@ func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*S // // Note: This endpoint is only available to organizations with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-usage-report-for-an-organization // //meta:operation GET /organizations/{org}/settings/billing/usage func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error) { @@ -298,8 +298,8 @@ func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org str return nil, nil, err } - usageReport := new(UsageReport) - resp, err := s.client.Do(ctx, req, usageReport) + var usageReport *UsageReport + resp, err := s.client.Do(ctx, req, &usageReport) if err != nil { return nil, resp, err } @@ -311,7 +311,7 @@ func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org str // // Note: This endpoint is only available to users with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-usage-report-for-a-user // //meta:operation GET /users/{username}/settings/billing/usage func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error) { @@ -326,8 +326,8 @@ func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts * return nil, nil, err } - usageReport := new(UsageReport) - resp, err := s.client.Do(ctx, req, usageReport) + var usageReport *UsageReport + resp, err := s.client.Do(ctx, req, &usageReport) if err != nil { return nil, resp, err } @@ -340,7 +340,7 @@ func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts * // // Note: This endpoint is only available to organizations with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-premium-request-usage-report-for-an-organization // //meta:operation GET /organizations/{org}/settings/billing/premium_request/usage func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) { @@ -355,8 +355,8 @@ func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Co return nil, nil, err } - premiumRequestUsageReport := new(PremiumRequestUsageReport) - resp, err := s.client.Do(ctx, req, premiumRequestUsageReport) + var premiumRequestUsageReport *PremiumRequestUsageReport + resp, err := s.client.Do(ctx, req, &premiumRequestUsageReport) if err != nil { return nil, resp, err } @@ -369,7 +369,7 @@ func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Co // // Note: This endpoint is only available to users with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-premium-request-usage-report-for-a-user // //meta:operation GET /users/{username}/settings/billing/premium_request/usage func (s *BillingService) GetPremiumRequestUsageReport(ctx context.Context, user string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) { @@ -384,8 +384,8 @@ func (s *BillingService) GetPremiumRequestUsageReport(ctx context.Context, user return nil, nil, err } - premiumRequestUsageReport := new(PremiumRequestUsageReport) - resp, err := s.client.Do(ctx, req, premiumRequestUsageReport) + var premiumRequestUsageReport *PremiumRequestUsageReport + resp, err := s.client.Do(ctx, req, &premiumRequestUsageReport) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/checks.go b/vendor/github.com/google/go-github/v85/github/checks.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/checks.go rename to vendor/github.com/google/go-github/v85/github/checks.go index d39cfa536..b28cd06c6 100644 --- a/vendor/github.com/google/go-github/v82/github/checks.go +++ b/vendor/github.com/google/go-github/v85/github/checks.go @@ -13,7 +13,7 @@ import ( // ChecksService provides access to the Checks API in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/checks/ +// GitHub API docs: https://docs.github.com/rest/checks?apiVersion=2022-11-28 type ChecksService service // CheckRun represents a GitHub check run on a repository associated with a GitHub app. @@ -101,7 +101,7 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#get-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#get-a-check-run // //meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { @@ -113,8 +113,8 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkRun := new(CheckRun) - resp, err := s.client.Do(ctx, req, checkRun) + var checkRun *CheckRun + resp, err := s.client.Do(ctx, req, &checkRun) if err != nil { return nil, resp, err } @@ -124,7 +124,7 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#get-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#get-a-check-suite // //meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id} func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { @@ -136,8 +136,8 @@ func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, c req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkSuite := new(CheckSuite) - resp, err := s.client.Do(ctx, req, checkSuite) + var checkSuite *CheckSuite + resp, err := s.client.Do(ctx, req, &checkSuite) if err != nil { return nil, resp, err } @@ -168,7 +168,7 @@ type CheckRunAction struct { // CreateCheckRun creates a check run for repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#create-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run // //meta:operation POST /repos/{owner}/{repo}/check-runs func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) { @@ -180,8 +180,8 @@ func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkRun := new(CheckRun) - resp, err := s.client.Do(ctx, req, checkRun) + var checkRun *CheckRun + resp, err := s.client.Do(ctx, req, &checkRun) if err != nil { return nil, resp, err } @@ -203,7 +203,7 @@ type UpdateCheckRunOptions struct { // UpdateCheckRun updates a check run for a specific commit in a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#update-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#update-a-check-run // //meta:operation PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) { @@ -215,8 +215,8 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkRun := new(CheckRun) - resp, err := s.client.Do(ctx, req, checkRun) + var checkRun *CheckRun + resp, err := s.client.Do(ctx, req, &checkRun) if err != nil { return nil, resp, err } @@ -226,7 +226,7 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-run-annotations +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-run-annotations // //meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { @@ -272,7 +272,7 @@ type ListCheckRunsResults struct { // The ref can be a commit SHA, branch name `heads/`, or tag name `tags/`. // For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-for-a-git-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-runs func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { @@ -300,7 +300,7 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re // ListCheckRunsCheckSuite lists check runs for a check suite. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-in-a-check-suite // //meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { @@ -328,7 +328,7 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo // ReRequestCheckRun triggers GitHub to rerequest an existing check run. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#rerequest-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#rerequest-a-check-run // //meta:operation POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) { @@ -362,7 +362,7 @@ type ListCheckSuiteResults struct { // The ref can be a commit SHA, branch name `heads/`, or tag name `tags/`. // For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#list-check-suites-for-a-git-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-suites func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { @@ -412,7 +412,7 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#update-repository-preferences-for-check-suites // //meta:operation PATCH /repos/{owner}/{repo}/check-suites/preferences func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { @@ -433,7 +433,7 @@ func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, rep return checkSuitePrefResults, resp, nil } -// CreateCheckSuiteOptions sets up parameters to manually create a check suites. +// CreateCheckSuiteOptions sets up parameters to manually create a check suite. type CreateCheckSuiteOptions struct { HeadSHA string `json:"head_sha"` // The sha of the head commit. (Required.) HeadBranch *string `json:"head_branch,omitempty"` // The name of the head branch where the code changes are implemented. @@ -441,7 +441,7 @@ type CreateCheckSuiteOptions struct { // CreateCheckSuite manually creates a check suite for a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#create-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#create-a-check-suite // //meta:operation POST /repos/{owner}/{repo}/check-suites func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) { @@ -453,8 +453,8 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkSuite := new(CheckSuite) - resp, err := s.client.Do(ctx, req, checkSuite) + var checkSuite *CheckSuite + resp, err := s.client.Do(ctx, req, &checkSuite) if err != nil { return nil, resp, err } @@ -464,7 +464,7 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#rerequest-a-check-suite // //meta:operation POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/classroom.go b/vendor/github.com/google/go-github/v85/github/classroom.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/classroom.go rename to vendor/github.com/google/go-github/v85/github/classroom.go index 47124dd4a..325516127 100644 --- a/vendor/github.com/google/go-github/v82/github/classroom.go +++ b/vendor/github.com/google/go-github/v85/github/classroom.go @@ -13,7 +13,7 @@ import ( // ClassroomService handles communication with the GitHub Classroom related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28 type ClassroomService service // ClassroomUser represents a GitHub user simplified for Classroom. @@ -107,7 +107,7 @@ func (g AssignmentGrade) String() string { // returned if the current user is an administrator of the GitHub Classroom // for the assignment. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-an-assignment +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-an-assignment // //meta:operation GET /assignments/{assignment_id} func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64) (*ClassroomAssignment, *Response, error) { @@ -118,8 +118,8 @@ func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64 return nil, nil, err } - assignment := new(ClassroomAssignment) - resp, err := s.client.Do(ctx, req, assignment) + var assignment *ClassroomAssignment + resp, err := s.client.Do(ctx, req, &assignment) if err != nil { return nil, resp, err } @@ -130,7 +130,7 @@ func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64 // GetClassroom gets a GitHub Classroom for the current user. Classroom will only be // returned if the current user is an administrator of the GitHub Classroom. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-a-classroom +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-a-classroom // //meta:operation GET /classrooms/{classroom_id} func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) (*Classroom, *Response, error) { @@ -141,8 +141,8 @@ func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) return nil, nil, err } - classroom := new(Classroom) - resp, err := s.client.Do(ctx, req, classroom) + var classroom *Classroom + resp, err := s.client.Do(ctx, req, &classroom) if err != nil { return nil, resp, err } @@ -153,7 +153,7 @@ func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) // ListClassrooms lists GitHub Classrooms for the current user. Classrooms will only be // returned if the current user is an administrator of one or more GitHub Classrooms. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-classrooms +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-classrooms // //meta:operation GET /classrooms func (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions) ([]*Classroom, *Response, error) { @@ -179,7 +179,7 @@ func (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions // ListClassroomAssignments lists GitHub Classroom assignments for a classroom. Assignments will only be // returned if the current user is an administrator of the GitHub Classroom. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-assignments-for-a-classroom // //meta:operation GET /classrooms/{classroom_id}/assignments func (s *ClassroomService) ListClassroomAssignments(ctx context.Context, classroomID int64, opts *ListOptions) ([]*ClassroomAssignment, *Response, error) { @@ -207,7 +207,7 @@ func (s *ClassroomService) ListClassroomAssignments(ctx context.Context, classro // Accepted assignments will only be returned if the current user is an administrator // of the GitHub Classroom for the assignment. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-accepted-assignments-for-an-assignment // //meta:operation GET /assignments/{assignment_id}/accepted_assignments func (s *ClassroomService) ListAcceptedAssignments(ctx context.Context, assignmentID int64, opts *ListOptions) ([]*AcceptedAssignment, *Response, error) { @@ -235,7 +235,7 @@ func (s *ClassroomService) ListAcceptedAssignments(ctx context.Context, assignme // Grades will only be returned if the current user is an administrator // of the GitHub Classroom for the assignment. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-assignment-grades +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-assignment-grades // //meta:operation GET /assignments/{assignment_id}/grades func (s *ClassroomService) GetAssignmentGrades(ctx context.Context, assignmentID int64) ([]*AssignmentGrade, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/code_scanning.go b/vendor/github.com/google/go-github/v85/github/code_scanning.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/code_scanning.go rename to vendor/github.com/google/go-github/v85/github/code_scanning.go index 982efc459..d6e6bee97 100644 --- a/vendor/github.com/google/go-github/v82/github/code_scanning.go +++ b/vendor/github.com/google/go-github/v85/github/code_scanning.go @@ -17,7 +17,7 @@ import ( // CodeScanningService handles communication with the code scanning related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type CodeScanningService service // Rule represents the complete details of GitHub Code Scanning alert type. @@ -69,7 +69,7 @@ type Tool struct { // Alert represents an individual GitHub Code Scanning Alert on a single repository. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type Alert struct { Number *int `json:"number,omitempty"` Repository *Repository `json:"repository,omitempty"` @@ -171,7 +171,7 @@ type AnalysesListOptions struct { // CodeQLDatabase represents a metadata about the CodeQL database. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type CodeQLDatabase struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -186,7 +186,7 @@ type CodeQLDatabase struct { // ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type ScanningAnalysis struct { ID *int64 `json:"id,omitempty"` Ref *string `json:"ref,omitempty"` @@ -207,7 +207,7 @@ type ScanningAnalysis struct { // SarifAnalysis specifies the results of a code scanning job. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type SarifAnalysis struct { CommitSHA *string `json:"commit_sha,omitempty"` Ref *string `json:"ref,omitempty"` @@ -219,7 +219,7 @@ type SarifAnalysis struct { // CodeScanningAlertState specifies the state of a code scanning alert. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type CodeScanningAlertState struct { // State sets the state of the code scanning alert and is a required field. // You must also provide DismissedReason when you set the state to "dismissed". @@ -235,7 +235,7 @@ type CodeScanningAlertState struct { // SarifID identifies a sarif analysis upload. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type SarifID struct { ID *string `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -246,7 +246,7 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-alerts-for-an-organization // //meta:operation GET /orgs/{org}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { @@ -276,7 +276,7 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-alerts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { @@ -307,7 +307,7 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { @@ -318,8 +318,8 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, return nil, nil, err } - a := new(Alert) - resp, err := s.client.Do(ctx, req, a) + var a *Alert + resp, err := s.client.Do(ctx, req, &a) if err != nil { return nil, resp, err } @@ -334,7 +334,7 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert // //meta:operation PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { @@ -345,8 +345,8 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin return nil, nil, err } - a := new(Alert) - resp, err := s.client.Do(ctx, req, a) + var a *Alert + resp, err := s.client.Do(ctx, req, &a) if err != nil { return nil, resp, err } @@ -359,7 +359,7 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-instances-of-a-code-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { @@ -389,7 +389,7 @@ func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, rep // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#upload-an-analysis-as-sarif-data // //meta:operation POST /repos/{owner}/{repo}/code-scanning/sarifs func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { @@ -410,8 +410,8 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin if !errors.As(err, &acceptedError) { return nil, resp, err } - sarifID := new(SarifID) - decErr := json.Unmarshal(acceptedError.Raw, sarifID) + var sarifID *SarifID + decErr := json.Unmarshal(acceptedError.Raw, &sarifID) if decErr != nil { return nil, resp, decErr } @@ -433,7 +433,7 @@ type SARIFUpload struct { // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-information-about-a-sarif-upload // //meta:operation GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { @@ -444,8 +444,8 @@ func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID return nil, nil, err } - sarifUpload := new(SARIFUpload) - resp, err := s.client.Do(ctx, req, sarifUpload) + var sarifUpload *SARIFUpload + resp, err := s.client.Do(ctx, req, &sarifUpload) if err != nil { return nil, resp, err } @@ -459,7 +459,7 @@ func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-analyses-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { @@ -490,7 +490,7 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-analysis-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { @@ -501,8 +501,8 @@ func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo strin return nil, nil, err } - analysis := new(ScanningAnalysis) - resp, err := s.client.Do(ctx, req, analysis) + var analysis *ScanningAnalysis + resp, err := s.client.Do(ctx, req, &analysis) if err != nil { return nil, resp, err } @@ -525,7 +525,7 @@ type DeleteAnalysis struct { // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#delete-a-code-scanning-analysis-from-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { @@ -536,8 +536,8 @@ func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo st return nil, nil, err } - deleteAnalysis := new(DeleteAnalysis) - resp, err := s.client.Do(ctx, req, deleteAnalysis) + var deleteAnalysis *DeleteAnalysis + resp, err := s.client.Do(ctx, req, &deleteAnalysis) if err != nil { return nil, resp, err } @@ -550,7 +550,7 @@ func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo st // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-codeql-databases-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { @@ -575,7 +575,7 @@ func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, re // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-codeql-database-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { @@ -586,8 +586,8 @@ func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo return nil, nil, err } - codeqlDatabase := new(CodeQLDatabase) - resp, err := s.client.Do(ctx, req, codeqlDatabase) + var codeqlDatabase *CodeQLDatabase + resp, err := s.client.Do(ctx, req, &codeqlDatabase) if err != nil { return nil, resp, err } @@ -609,7 +609,7 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-default-setup-configuration // //meta:operation GET /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { @@ -620,8 +620,8 @@ func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, return nil, nil, err } - cfg := new(DefaultSetupConfiguration) - resp, err := s.client.Do(ctx, req, cfg) + var cfg *DefaultSetupConfiguration + resp, err := s.client.Do(ctx, req, &cfg) if err != nil { return nil, resp, err } @@ -652,7 +652,7 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-default-setup-configuration // //meta:operation PATCH /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { @@ -663,8 +663,8 @@ func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Contex return nil, nil, err } - a := new(UpdateDefaultSetupConfigurationResponse) - resp, err := s.client.Do(ctx, req, a) + var a *UpdateDefaultSetupConfigurationResponse + resp, err := s.client.Do(ctx, req, &a) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/codesofconduct.go b/vendor/github.com/google/go-github/v85/github/codesofconduct.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/codesofconduct.go rename to vendor/github.com/google/go-github/v85/github/codesofconduct.go index a514aac6b..6bf590e12 100644 --- a/vendor/github.com/google/go-github/v82/github/codesofconduct.go +++ b/vendor/github.com/google/go-github/v85/github/codesofconduct.go @@ -27,7 +27,7 @@ func (c *CodeOfConduct) String() string { // List returns all codes of conduct. // -// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct?apiVersion=2022-11-28#get-all-codes-of-conduct // //meta:operation GET /codes_of_conduct func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Response, error) { @@ -56,7 +56,7 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // Get returns an individual code of conduct. // -// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct?apiVersion=2022-11-28#get-a-code-of-conduct // //meta:operation GET /codes_of_conduct/{key} func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { @@ -68,8 +68,8 @@ func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfCon req.Header.Set("Accept", mediaTypeCodesOfConductPreview) - coc := new(CodeOfConduct) - resp, err := s.client.Do(ctx, req, coc) + var coc *CodeOfConduct + resp, err := s.client.Do(ctx, req, &coc) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/codespaces.go b/vendor/github.com/google/go-github/v85/github/codespaces.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/codespaces.go rename to vendor/github.com/google/go-github/v85/github/codespaces.go index bc8d617f3..66180cd5c 100644 --- a/vendor/github.com/google/go-github/v82/github/codespaces.go +++ b/vendor/github.com/google/go-github/v85/github/codespaces.go @@ -13,12 +13,12 @@ import ( // CodespacesService handles communication with the Codespaces related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/codespaces/ +// GitHub API docs: https://docs.github.com/rest/codespaces?apiVersion=2022-11-28 type CodespacesService service // Codespace represents a codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces +// GitHub API docs: https://docs.github.com/rest/codespaces?apiVersion=2022-11-28 type Codespace struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -90,7 +90,7 @@ type ListCodespaces struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/codespaces func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) { @@ -126,7 +126,7 @@ type ListCodespacesOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user // //meta:operation GET /user/codespaces func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { @@ -270,7 +270,7 @@ type CodespacePermissions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository // //meta:operation POST /repos/{owner}/{repo}/codespaces func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error) { @@ -294,7 +294,7 @@ func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#start-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces/{codespace_name}/start func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { @@ -318,7 +318,7 @@ func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*C // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#stop-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces/{codespace_name}/stop func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { @@ -342,7 +342,7 @@ func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Co // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user // //meta:operation DELETE /user/codespaces/{codespace_name} func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) { @@ -357,7 +357,7 @@ func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (* // ListDevContainerConfigurations lists devcontainer configurations in a repository for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/codespaces/devcontainers func (s *CodespacesService) ListDevContainerConfigurations(ctx context.Context, owner, repo string, opts *ListOptions) (*DevContainerConfigurations, *Response, error) { @@ -383,7 +383,7 @@ func (s *CodespacesService) ListDevContainerConfigurations(ctx context.Context, // GetDefaultAttributes gets the default attributes for codespaces created by the user with the repository. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-default-attributes-for-a-codespace // //meta:operation GET /repos/{owner}/{repo}/codespaces/new func (s *CodespacesService) GetDefaultAttributes(ctx context.Context, owner, repo string, opts *CodespaceGetDefaultAttributesOptions) (*CodespaceDefaultAttributes, *Response, error) { @@ -409,7 +409,7 @@ func (s *CodespacesService) GetDefaultAttributes(ctx context.Context, owner, rep // CheckPermissions checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/codespaces/permissions_check func (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, ref, devcontainerPath string) (*CodespacePermissions, *Response, error) { @@ -441,7 +441,7 @@ func (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, r // CreateFromPullRequest creates a codespace owned by the authenticated user for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-from-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces func (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, repo string, pullNumber int, request *CreateCodespaceOptions) (*Codespace, *Response, error) { @@ -464,7 +464,7 @@ func (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, re // // This method requires either RepositoryId OR a PullRequest but not both. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces func (s *CodespacesService) Create(ctx context.Context, opts *CodespaceCreateForUserOptions) (*Codespace, *Response, error) { @@ -485,7 +485,7 @@ func (s *CodespacesService) Create(ctx context.Context, opts *CodespaceCreateFor // Get gets information about a user's codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-a-codespace-for-the-authenticated-user // //meta:operation GET /user/codespaces/{codespace_name} func (s *CodespacesService) Get(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { @@ -508,7 +508,7 @@ func (s *CodespacesService) Get(ctx context.Context, codespaceName string) (*Cod // // Only the codespace's machine type and recent folders can be modified using this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#update-a-codespace-for-the-authenticated-user // //meta:operation PATCH /user/codespaces/{codespace_name} func (s *CodespacesService) Update(ctx context.Context, codespaceName string, opts *UpdateCodespaceOptions) (*Codespace, *Response, error) { @@ -529,7 +529,7 @@ func (s *CodespacesService) Update(ctx context.Context, codespaceName string, op // ExportCodespace triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#export-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces/{codespace_name}/exports func (s *CodespacesService) ExportCodespace(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error) { @@ -550,7 +550,7 @@ func (s *CodespacesService) ExportCodespace(ctx context.Context, codespaceName s // GetLatestCodespaceExport gets information about an export of a codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-details-about-a-codespace-export // //meta:operation GET /user/codespaces/{codespace_name}/exports/{export_id} func (s *CodespacesService) GetLatestCodespaceExport(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error) { @@ -571,7 +571,7 @@ func (s *CodespacesService) GetLatestCodespaceExport(ctx context.Context, codesp // Publish publishes an unpublished codespace, creating a new repository and assigning it to the codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-repository-from-an-unpublished-codespace // //meta:operation POST /user/codespaces/{codespace_name}/publish func (s *CodespacesService) Publish(ctx context.Context, codespaceName string, opts *PublishCodespaceOptions) (*Codespace, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/codespaces_machines.go b/vendor/github.com/google/go-github/v85/github/codespaces_machines.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/codespaces_machines.go rename to vendor/github.com/google/go-github/v85/github/codespaces_machines.go index 5277b1f40..e89f4cc7a 100644 --- a/vendor/github.com/google/go-github/v82/github/codespaces_machines.go +++ b/vendor/github.com/google/go-github/v85/github/codespaces_machines.go @@ -28,7 +28,7 @@ type ListRepoMachineTypesOptions struct { // ListRepositoryMachineTypes lists the machine types available for a given repository based on its configuration. // -// GitHub API docs: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository +// GitHub API docs: https://docs.github.com/rest/codespaces/machines?apiVersion=2022-11-28#list-available-machine-types-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/codespaces/machines func (s *CodespacesService) ListRepositoryMachineTypes(ctx context.Context, owner, repo string, opts *ListRepoMachineTypesOptions) (*CodespacesMachines, *Response, error) { @@ -54,7 +54,7 @@ func (s *CodespacesService) ListRepositoryMachineTypes(ctx context.Context, owne // ListCodespaceMachineTypes lists the machine types a codespace can transition to use. // -// GitHub API docs: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace +// GitHub API docs: https://docs.github.com/rest/codespaces/machines?apiVersion=2022-11-28#list-machine-types-for-a-codespace // //meta:operation GET /user/codespaces/{codespace_name}/machines func (s *CodespacesService) ListCodespaceMachineTypes(ctx context.Context, codespaceName string) (*CodespacesMachines, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/codespaces_orgs.go b/vendor/github.com/google/go-github/v85/github/codespaces_orgs.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/codespaces_orgs.go rename to vendor/github.com/google/go-github/v85/github/codespaces_orgs.go index 3aeb05f86..cf3ad0bc9 100644 --- a/vendor/github.com/google/go-github/v82/github/codespaces_orgs.go +++ b/vendor/github.com/google/go-github/v85/github/codespaces_orgs.go @@ -22,7 +22,7 @@ type CodespacesOrgAccessControlRequest struct { // ListInOrg lists the codespaces associated to a specified organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#list-codespaces-for-the-organization // //meta:operation GET /orgs/{org}/codespaces func (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *ListOptions) (*ListCodespaces, *Response, error) { @@ -48,7 +48,7 @@ func (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *Lis // SetOrgAccessControl sets which users can access codespaces in an organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#manage-access-control-for-organization-codespaces // //meta:operation PUT /orgs/{org}/codespaces/access func (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string, request CodespacesOrgAccessControlRequest) (*Response, error) { @@ -68,7 +68,7 @@ func (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string, // AddUsersToOrgAccess adds users to Codespaces access for an organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#add-users-to-codespaces-access-for-an-organization // //meta:operation POST /orgs/{org}/codespaces/access/selected_users func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) { @@ -88,7 +88,7 @@ func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, // RemoveUsersFromOrgAccess removes users from Codespaces access for an organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#remove-users-from-codespaces-access-for-an-organization // //meta:operation DELETE /orgs/{org}/codespaces/access/selected_users func (s *CodespacesService) RemoveUsersFromOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) { @@ -108,7 +108,7 @@ func (s *CodespacesService) RemoveUsersFromOrgAccess(ctx context.Context, org st // ListUserCodespacesInOrg lists the codespaces that a member of an organization has for repositories in that organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#list-codespaces-for-a-user-in-organization // //meta:operation GET /orgs/{org}/members/{username}/codespaces func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, username string, opts *ListOptions) (*ListCodespaces, *Response, error) { @@ -134,7 +134,7 @@ func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, us // DeleteUserCodespaceInOrg deletes a user's codespace from the organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#delete-a-codespace-from-the-organization // //meta:operation DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name} func (s *CodespacesService) DeleteUserCodespaceInOrg(ctx context.Context, org, username, codespaceName string) (*Response, error) { @@ -154,7 +154,7 @@ func (s *CodespacesService) DeleteUserCodespaceInOrg(ctx context.Context, org, u // StopUserCodespaceInOrg stops a codespace for an organization user. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#stop-a-codespace-for-an-organization-user // //meta:operation POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop func (s *CodespacesService) StopUserCodespaceInOrg(ctx context.Context, org, username, codespaceName string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/codespaces_secrets.go b/vendor/github.com/google/go-github/v85/github/codespaces_secrets.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/codespaces_secrets.go rename to vendor/github.com/google/go-github/v85/github/codespaces_secrets.go index ba4b9abd9..5d22683df 100644 --- a/vendor/github.com/google/go-github/v82/github/codespaces_secrets.go +++ b/vendor/github.com/google/go-github/v85/github/codespaces_secrets.go @@ -17,7 +17,7 @@ import ( // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user // //meta:operation GET /user/codespaces/secrets func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) { @@ -32,7 +32,7 @@ func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptio // // Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets // //meta:operation GET /orgs/{org}/codespaces/secrets func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { @@ -48,7 +48,7 @@ func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts // // Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets // //meta:operation GET /repos/{owner}/{repo}/codespaces/secrets func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -81,7 +81,7 @@ func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secre // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user // //meta:operation GET /user/codespaces/secrets/public-key func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) { @@ -92,7 +92,7 @@ func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, * // // Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key // //meta:operation GET /orgs/{org}/codespaces/secrets/public-key func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { @@ -103,7 +103,7 @@ func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*P // // Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key // //meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/public-key func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { @@ -131,7 +131,7 @@ func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*Publ // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user // //meta:operation GET /user/codespaces/secrets/{secret_name} func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) { @@ -143,7 +143,7 @@ func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Se // // Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret // //meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { @@ -155,7 +155,7 @@ func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) // // Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret // //meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { @@ -184,7 +184,7 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user // //meta:operation PUT /user/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { @@ -200,7 +200,7 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre // // Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { @@ -216,7 +216,7 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str // // Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret // //meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { @@ -248,7 +248,7 @@ func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user // //meta:operation DELETE /user/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) { @@ -260,7 +260,7 @@ func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) ( // // Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret // //meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { @@ -272,7 +272,7 @@ func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name strin // // Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret // //meta:operation DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -299,7 +299,7 @@ func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Resp // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret // //meta:operation GET /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -316,7 +316,7 @@ func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, // // Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret // //meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -349,7 +349,7 @@ func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret // //meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) { @@ -361,7 +361,7 @@ func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, n // // Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { @@ -391,7 +391,7 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st // // Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret // //meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { @@ -410,7 +410,7 @@ func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, nam // // Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -443,7 +443,7 @@ func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url str // // Removes a repository from the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#remove-a-selected-repository-from-a-user-secret // //meta:operation DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { @@ -462,7 +462,7 @@ func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context // // Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret // //meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/copilot.go b/vendor/github.com/google/go-github/v85/github/copilot.go similarity index 85% rename from vendor/github.com/google/go-github/v82/github/copilot.go rename to vendor/github.com/google/go-github/v85/github/copilot.go index 445b6dda0..dc29d52db 100644 --- a/vendor/github.com/google/go-github/v82/github/copilot.go +++ b/vendor/github.com/google/go-github/v85/github/copilot.go @@ -10,13 +10,14 @@ import ( "encoding/json" "errors" "fmt" + "net/http" "time" ) // CopilotService provides access to the Copilot-related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/copilot/ +// GitHub API docs: https://docs.github.com/rest/copilot?apiVersion=2022-11-28 type CopilotService service // CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription. @@ -224,7 +225,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { switch v := seatDetail.Assignee.(type) { case nil: // Assignee can be null according to GitHub API specification. - // See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization + // See: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization // Note: Copilot API is in public preview and subject to change. cp.Assignee = nil case map[string]any: @@ -238,20 +239,20 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { } if t, ok := v["type"].(string); ok && t == "User" { - user := &User{} - if err := json.Unmarshal(jsonData, user); err != nil { + var user *User + if err := json.Unmarshal(jsonData, &user); err != nil { return err } cp.Assignee = user } else if t, ok := v["type"].(string); ok && t == "Team" { - team := &Team{} - if err := json.Unmarshal(jsonData, team); err != nil { + var team *Team + if err := json.Unmarshal(jsonData, &team); err != nil { return err } cp.Assignee = team } else if t, ok := v["type"].(string); ok && t == "Organization" { - organization := &Organization{} - if err := json.Unmarshal(jsonData, organization); err != nil { + var organization *Organization + if err := json.Unmarshal(jsonData, &organization); err != nil { return err } cp.Assignee = organization @@ -279,7 +280,7 @@ func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { // GetCopilotBilling gets Copilot for Business billing information and settings for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#get-copilot-seat-information-and-settings-for-an-organization // //meta:operation GET /orgs/{org}/copilot/billing func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) { @@ -303,7 +304,7 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co // // To paginate through all seats, populate 'Page' with the number of the last page. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization // //meta:operation GET /orgs/{org}/copilot/billing/seats func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { @@ -331,7 +332,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // // To paginate through all seats, populate 'Page' with the number of the last page. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/copilot/billing/seats func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { @@ -357,7 +358,7 @@ func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterpr // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#add-teams-to-the-copilot-subscription-for-an-organization // //meta:operation POST /orgs/{org}/copilot/billing/selected_teams func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { @@ -385,7 +386,7 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNa // RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#remove-teams-from-the-copilot-subscription-for-an-organization // //meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { @@ -413,7 +414,7 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea // AddCopilotUsers adds users to the Copilot for Business subscription for an organization // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#add-users-to-the-copilot-subscription-for-an-organization // //meta:operation POST /orgs/{org}/copilot/billing/selected_users func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { @@ -441,7 +442,7 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users // RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#remove-users-from-the-copilot-subscription-for-an-organization // //meta:operation DELETE /orgs/{org}/copilot/billing/selected_users func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { @@ -469,7 +470,7 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use // GetSeatDetails gets Copilot for Business seat assignment details for a user. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#get-copilot-seat-assignment-details-for-a-user // //meta:operation GET /orgs/{org}/members/{username}/copilot func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) { @@ -491,7 +492,11 @@ func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) ( // GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetEnterpriseDailyMetricsReport +// or GetEnterpriseMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/copilot/metrics func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { @@ -517,7 +522,11 @@ func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise st // GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetEnterpriseDailyMetricsReport +// or GetEnterpriseMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-enterprise-team // //meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { @@ -543,7 +552,11 @@ func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterpris // GetOrganizationMetrics gets Copilot usage metrics for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetOrganizationDailyMetricsReport +// or GetOrganizationMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-organization // //meta:operation GET /orgs/{org}/copilot/metrics func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { @@ -569,7 +582,11 @@ func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, // GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetOrganizationDailyMetricsReport +// or GetOrganizationMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-a-team // //meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { @@ -595,7 +612,7 @@ func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, te // GetEnterpriseDailyMetricsReport gets a report containing Copilot metrics for a single day for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics-for-a-specific-day +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics-for-a-specific-day // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day func (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { @@ -621,7 +638,7 @@ func (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, en // GetEnterpriseMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest func (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) { @@ -643,7 +660,7 @@ func (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterpr // GetEnterpriseUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics-for-a-specific-day +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics-for-a-specific-day // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day func (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { @@ -669,7 +686,7 @@ func (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Contex // GetEnterpriseUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest func (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) { @@ -691,7 +708,7 @@ func (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, en // GetOrganizationDailyMetricsReport gets a report containing Copilot metrics for a single day for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics-for-a-specific-day +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics-for-a-specific-day // //meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-1-day func (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { @@ -717,7 +734,7 @@ func (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context, // GetOrganizationMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics // //meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest func (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) { @@ -739,7 +756,7 @@ func (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org s // GetOrganizationUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics-for-a-specific-day +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics-for-a-specific-day // //meta:operation GET /orgs/{org}/copilot/metrics/reports/users-1-day func (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { @@ -765,7 +782,7 @@ func (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Cont // GetOrganizationUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics // //meta:operation GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest func (s *CopilotService) GetOrganizationUsersMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) { @@ -784,3 +801,32 @@ func (s *CopilotService) GetOrganizationUsersMetricsReport(ctx context.Context, return report, resp, nil } + +// DownloadCopilotMetrics downloads a Copilot metrics report from the provided download link +// and returns the metric data. This can be used to download metrics from a link returned by +// GetEnterpriseDailyMetricsReport, GetEnterpriseMetricsReport, GetEnterpriseUsersDailyMetricsReport, +// GetEnterpriseUsersMetricsReport, GetOrganizationDailyMetricsReport, GetOrganizationMetricsReport, +// GetOrganizationUsersDailyMetricsReport, GetOrganizationUsersMetricsReport. +func (s *CopilotService) DownloadCopilotMetrics(ctx context.Context, url string) ([]*CopilotMetrics, *Response, error) { + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, nil, err + } + + resp, err := s.client.client.Do(req) + if err != nil { + return nil, nil, err + } + defer resp.Body.Close() + + if err := CheckResponse(resp); err != nil { + return nil, newResponse(resp), err + } + + var metrics []*CopilotMetrics + if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { + return nil, newResponse(resp), err + } + + return metrics, newResponse(resp), nil +} diff --git a/vendor/github.com/google/go-github/v82/github/credentials.go b/vendor/github.com/google/go-github/v85/github/credentials.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/credentials.go rename to vendor/github.com/google/go-github/v85/github/credentials.go index ff6e6f691..7d4744539 100644 --- a/vendor/github.com/google/go-github/v82/github/credentials.go +++ b/vendor/github.com/google/go-github/v85/github/credentials.go @@ -20,7 +20,7 @@ type revokeCredentialsRequest struct { // Revoke revokes a list of credentials. // -// GitHub API docs: https://docs.github.com/rest/credentials/revoke#revoke-a-list-of-credentials +// GitHub API docs: https://docs.github.com/rest/credentials/revoke?apiVersion=2022-11-28#revoke-a-list-of-credentials // //meta:operation POST /credentials/revoke func (s *CredentialsService) Revoke(ctx context.Context, credentials []string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/dependabot.go b/vendor/github.com/google/go-github/v85/github/dependabot.go similarity index 79% rename from vendor/github.com/google/go-github/v82/github/dependabot.go rename to vendor/github.com/google/go-github/v85/github/dependabot.go index 2a11a9c95..5e4f73544 100644 --- a/vendor/github.com/google/go-github/v82/github/dependabot.go +++ b/vendor/github.com/google/go-github/v85/github/dependabot.go @@ -8,5 +8,5 @@ package github // DependabotService handles communication with the Dependabot related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/dependabot/ +// GitHub API docs: https://docs.github.com/rest/dependabot?apiVersion=2022-11-28 type DependabotService service diff --git a/vendor/github.com/google/go-github/v82/github/dependabot_alerts.go b/vendor/github.com/google/go-github/v85/github/dependabot_alerts.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/dependabot_alerts.go rename to vendor/github.com/google/go-github/v85/github/dependabot_alerts.go index 67e624c9e..9a55485ce 100644 --- a/vendor/github.com/google/go-github/v82/github/dependabot_alerts.go +++ b/vendor/github.com/google/go-github/v85/github/dependabot_alerts.go @@ -125,7 +125,7 @@ func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *Li // ListRepoAlerts lists all Dependabot alerts of a repository. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#list-dependabot-alerts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/dependabot/alerts func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { @@ -135,7 +135,7 @@ func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo stri // ListOrgAlerts lists all Dependabot alerts of an organization. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#list-dependabot-alerts-for-an-organization // //meta:operation GET /orgs/{org}/dependabot/alerts func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { @@ -145,7 +145,7 @@ func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts // GetRepoAlert gets a single repository Dependabot alert. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#get-a-dependabot-alert // //meta:operation GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) { @@ -155,8 +155,8 @@ func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string return nil, nil, err } - alert := new(DependabotAlert) - resp, err := s.client.Do(ctx, req, alert) + var alert *DependabotAlert + resp, err := s.client.Do(ctx, req, &alert) if err != nil { return nil, resp, err } @@ -166,7 +166,7 @@ func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string // UpdateAlert updates a Dependabot alert. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#update-a-dependabot-alert // //meta:operation PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} func (s *DependabotService) UpdateAlert(ctx context.Context, owner, repo string, number int, stateInfo *DependabotAlertState) (*DependabotAlert, *Response, error) { @@ -176,8 +176,8 @@ func (s *DependabotService) UpdateAlert(ctx context.Context, owner, repo string, return nil, nil, err } - alert := new(DependabotAlert) - resp, err := s.client.Do(ctx, req, alert) + var alert *DependabotAlert + resp, err := s.client.Do(ctx, req, &alert) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v85/github/dependabot_secrets.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v85/github/dependabot_secrets.go index b4b3e0aa5..85b460f75 100644 --- a/vendor/github.com/google/go-github/v82/github/dependabot_secrets.go +++ b/vendor/github.com/google/go-github/v85/github/dependabot_secrets.go @@ -17,8 +17,8 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ return nil, nil, err } - pubKey := new(PublicKey) - resp, err := s.client.Do(ctx, req, pubKey) + var pubKey *PublicKey + resp, err := s.client.Do(ctx, req, &pubKey) if err != nil { return nil, resp, err } @@ -28,7 +28,7 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ // GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-a-repository-public-key // //meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/public-key func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { @@ -38,7 +38,7 @@ func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo st // GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-an-organization-public-key // //meta:operation GET /orgs/{org}/dependabot/secrets/public-key func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { @@ -57,7 +57,7 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L return nil, nil, err } - secrets := new(Secrets) + var secrets *Secrets resp, err := s.client.Do(ctx, req, &secrets) if err != nil { return nil, resp, err @@ -69,7 +69,7 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L // ListRepoSecrets lists all Dependabot secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#list-repository-secrets // //meta:operation GET /repos/{owner}/{repo}/dependabot/secrets func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -80,7 +80,7 @@ func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all Dependabot secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#list-organization-secrets // //meta:operation GET /orgs/{org}/dependabot/secrets func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { @@ -94,8 +94,8 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, return nil, nil, err } - secret := new(Secret) - resp, err := s.client.Do(ctx, req, secret) + var secret *Secret + resp, err := s.client.Do(ctx, req, &secret) if err != nil { return nil, resp, err } @@ -105,7 +105,7 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, // GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-a-repository-secret // //meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { @@ -115,7 +115,7 @@ func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name // GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-an-organization-secret // //meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { @@ -147,7 +147,7 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret // //meta:operation PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { @@ -161,7 +161,7 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { @@ -201,7 +201,7 @@ func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Resp // DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#delete-a-repository-secret // //meta:operation DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -211,7 +211,7 @@ func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, n // DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#delete-an-organization-secret // //meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { @@ -221,7 +221,7 @@ func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name strin // ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret // //meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -236,8 +236,8 @@ func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, o return nil, nil, err } - result := new(SelectedReposList) - resp, err := s.client.Do(ctx, req, result) + var result *SelectedReposList + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -250,7 +250,7 @@ type DependabotSecretsSelectedRepoIDs []int64 // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { @@ -269,7 +269,7 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or // AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -291,7 +291,7 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, // RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret // //meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/dependency_graph.go b/vendor/github.com/google/go-github/v85/github/dependency_graph.go similarity index 97% rename from vendor/github.com/google/go-github/v82/github/dependency_graph.go rename to vendor/github.com/google/go-github/v85/github/dependency_graph.go index 8d9a26313..05da21950 100644 --- a/vendor/github.com/google/go-github/v82/github/dependency_graph.go +++ b/vendor/github.com/google/go-github/v85/github/dependency_graph.go @@ -13,7 +13,7 @@ import ( // DependencyGraphService handles communication with the dependency graph // related methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph +// GitHub API docs: https://docs.github.com/rest/dependency-graph?apiVersion=2022-11-28 type DependencyGraphService service // SBOM represents a software bill of materials, which describes the @@ -108,7 +108,7 @@ func (s SBOM) String() string { // GetSBOM fetches the software bill of materials for a repository. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/dependency_graph_snapshots.go b/vendor/github.com/google/go-github/v85/github/dependency_graph_snapshots.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/dependency_graph_snapshots.go rename to vendor/github.com/google/go-github/v85/github/dependency_graph_snapshots.go index ddfecf429..0002685b7 100644 --- a/vendor/github.com/google/go-github/v82/github/dependency_graph_snapshots.go +++ b/vendor/github.com/google/go-github/v85/github/dependency_graph_snapshots.go @@ -12,7 +12,7 @@ import ( // DependencyGraphSnapshotResolvedDependency represents a resolved dependency in a dependency graph snapshot. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotResolvedDependency struct { PackageURL *string `json:"package_url,omitempty"` // User-defined metadata to store domain-specific information limited to 8 keys with scalar values. @@ -39,7 +39,7 @@ type DependencyGraphSnapshotResolvedDependency struct { // DependencyGraphSnapshotJob represents the job that created the snapshot. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotJob struct { Correlator *string `json:"correlator,omitempty"` ID *string `json:"id,omitempty"` @@ -48,7 +48,7 @@ type DependencyGraphSnapshotJob struct { // DependencyGraphSnapshotDetector represents a description of the detector used. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotDetector struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -57,14 +57,14 @@ type DependencyGraphSnapshotDetector struct { // DependencyGraphSnapshotManifestFile represents the file declaring the repository's dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotManifestFile struct { SourceLocation *string `json:"source_location,omitempty"` } // DependencyGraphSnapshotManifest represents a collection of related dependencies declared in a file or representing a logical group of dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotManifest struct { Name *string `json:"name,omitempty"` File *DependencyGraphSnapshotManifestFile `json:"file,omitempty"` @@ -74,7 +74,7 @@ type DependencyGraphSnapshotManifest struct { // DependencyGraphSnapshot represent a snapshot of a repository's dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshot struct { Version int `json:"version"` Sha *string `json:"sha,omitempty"` @@ -88,7 +88,7 @@ type DependencyGraphSnapshot struct { // DependencyGraphSnapshotCreationData represents the dependency snapshot's creation result. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotCreationData struct { ID int64 `json:"id"` CreatedAt *Timestamp `json:"created_at,omitempty"` @@ -103,7 +103,7 @@ type DependencyGraphSnapshotCreationData struct { // CreateSnapshot creates a new snapshot of a repository's dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/dependency-graph/snapshots func (s *DependencyGraphService) CreateSnapshot(ctx context.Context, owner, repo string, dependencyGraphSnapshot *DependencyGraphSnapshot) (*DependencyGraphSnapshotCreationData, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/doc.go b/vendor/github.com/google/go-github/v85/github/doc.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/doc.go rename to vendor/github.com/google/go-github/v85/github/doc.go index 850f3ddba..dc5fe621c 100644 --- a/vendor/github.com/google/go-github/v82/github/doc.go +++ b/vendor/github.com/google/go-github/v85/github/doc.go @@ -8,8 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v82/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) - import "github.com/google/go-github/github" // with go modules disabled + import "github.com/google/go-github/v85/github" Construct a new GitHub client, then use the various services on the client to access different parts of the GitHub API. For example: @@ -29,7 +28,7 @@ Some API methods have optional parameters that can be passed. For example: The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at -https://docs.github.com/rest . +https://docs.github.com/rest?apiVersion=2022-11-28. NOTE: Using the [context] package, one can easily pass cancellation signals and deadlines to various services of the client for @@ -119,7 +118,7 @@ For secondary rate limits, you can check if its type is *[AbuseRateLimitError]: } Learn more about GitHub rate limiting at -https://docs.github.com/rest/rate-limit . +https://docs.github.com/rest/rate-limit?apiVersion=2022-11-28. # Accepted Status @@ -151,7 +150,7 @@ recommended when making requests using short-lived credentials such as a GitHub App installation token. Learn more about GitHub conditional requests at -https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requests. +https://docs.github.com/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate. # Creating and Updating Resources diff --git a/vendor/github.com/google/go-github/v82/github/emojis.go b/vendor/github.com/google/go-github/v85/github/emojis.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/emojis.go rename to vendor/github.com/google/go-github/v85/github/emojis.go index b7a03dd98..fa3af4ae6 100644 --- a/vendor/github.com/google/go-github/v82/github/emojis.go +++ b/vendor/github.com/google/go-github/v85/github/emojis.go @@ -14,7 +14,7 @@ type EmojisService service // List returns the emojis available to use on GitHub. // -// GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis +// GitHub API docs: https://docs.github.com/rest/emojis/emojis?apiVersion=2022-11-28#get-emojis // //meta:operation GET /emojis func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise.go b/vendor/github.com/google/go-github/v85/github/enterprise.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/enterprise.go rename to vendor/github.com/google/go-github/v85/github/enterprise.go index 2036f8bc7..f808a2926 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise.go @@ -8,5 +8,5 @@ package github // EnterpriseService provides access to the enterprise related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin/ +// GitHub API docs: https://docs.github.com/rest/enterprise-admin?apiVersion=2022-11-28 type EnterpriseService service diff --git a/vendor/github.com/google/go-github/v85/github/enterprise_actions_hosted_runners.go b/vendor/github.com/google/go-github/v85/github/enterprise_actions_hosted_runners.go new file mode 100644 index 000000000..75a5d7bfd --- /dev/null +++ b/vendor/github.com/google/go-github/v85/github/enterprise_actions_hosted_runners.go @@ -0,0 +1,344 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// ListHostedRunners lists all the GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#list-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var runners *HostedRunners + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#create-a-github-hosted-runner-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(&request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-owned-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned +func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(ctx, req, &hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-partner-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner +func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(ctx, req, &hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-limits-on-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits +func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var publicIPLimits *HostedRunnerPublicIPLimits + resp, err := s.client.Do(ctx, req, &publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-hosted-runners-machine-specs-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes +func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var machineSpecs *HostedRunnerMachineSpecs + resp, err := s.client.Do(ctx, req, &machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-platforms-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms +func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var platforms *HostedRunnerPlatforms + resp, err := s.client.Do(ctx, req, &platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-github-hosted-runner-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#update-a-github-hosted-runner-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("PATCH", u, request) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-github-hosted-runner-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(ctx, req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// ListHostedRunnerCustomImages lists custom images for GitHub-hosted runners in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#list-custom-images-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom +func (s *EnterpriseService) ListHostedRunnerCustomImages(ctx context.Context, enterprise string) (*HostedRunnerCustomImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var images *HostedRunnerCustomImages + resp, err := s.client.Do(ctx, req, &images) + if err != nil { + return nil, resp, err + } + + return images, resp, nil +} + +// GetHostedRunnerCustomImage gets a custom image definition for GitHub-hosted runners in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-an-enterprise-custom-image-definition-for-github-actions-hosted-runners +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *EnterpriseService) GetHostedRunnerCustomImage(ctx context.Context, enterprise string, imageDefinitionID int64) (*HostedRunnerCustomImage, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v", enterprise, imageDefinitionID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var image *HostedRunnerCustomImage + resp, err := s.client.Do(ctx, req, &image) + if err != nil { + return nil, resp, err + } + + return image, resp, nil +} + +// DeleteHostedRunnerCustomImage deletes a custom image from the enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-custom-image-from-the-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *EnterpriseService) DeleteHostedRunnerCustomImage(ctx context.Context, enterprise string, imageDefinitionID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v", enterprise, imageDefinitionID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListHostedRunnerCustomImageVersions lists image versions of a custom image for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#list-image-versions-of-a-custom-image-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions +func (s *EnterpriseService) ListHostedRunnerCustomImageVersions(ctx context.Context, enterprise string, imageDefinitionID int64) (*HostedRunnerCustomImageVersions, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v/versions", enterprise, imageDefinitionID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var versions *HostedRunnerCustomImageVersions + resp, err := s.client.Do(ctx, req, &versions) + if err != nil { + return nil, resp, err + } + + return versions, resp, nil +} + +// GetHostedRunnerCustomImageVersion gets an image version of a custom image for GitHub-hosted runners in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-an-image-version-of-an-enterprise-custom-image-for-github-actions-hosted-runners +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *EnterpriseService) GetHostedRunnerCustomImageVersion(ctx context.Context, enterprise string, imageDefinitionID int64, version string) (*HostedRunnerCustomImageVersion, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v/versions/%v", enterprise, imageDefinitionID, version) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var imageVersion *HostedRunnerCustomImageVersion + resp, err := s.client.Do(ctx, req, &imageVersion) + if err != nil { + return nil, resp, err + } + + return imageVersion, resp, nil +} + +// DeleteHostedRunnerCustomImageVersion deletes an image version of a custom image from the enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-an-image-version-of-custom-image-from-the-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *EnterpriseService) DeleteHostedRunnerCustomImageVersion(ctx context.Context, enterprise string, imageDefinitionID int64, version string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v/versions/%v", enterprise, imageDefinitionID, version) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_actions_runner_groups.go b/vendor/github.com/google/go-github/v85/github/enterprise_actions_runner_groups.go similarity index 84% rename from vendor/github.com/google/go-github/v82/github/enterprise_actions_runner_groups.go rename to vendor/github.com/google/go-github/v85/github/enterprise_actions_runner_groups.go index f171df757..1e78ee3a7 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_actions_runner_groups.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_actions_runner_groups.go @@ -24,6 +24,8 @@ type EnterpriseRunnerGroup struct { Default *bool `json:"default,omitempty"` SelectedOrganizationsURL *string `json:"selected_organizations_url,omitempty"` RunnersURL *string `json:"runners_url,omitempty"` + HostedRunnersURL *string `json:"hosted_runners_url,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` Inherited *bool `json:"inherited,omitempty"` AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` @@ -51,6 +53,8 @@ type CreateEnterpriseRunnerGroupRequest struct { RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` // List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true. SelectedWorkflows []string `json:"selected_workflows,omitempty"` + // The identifier of a hosted compute network configuration. + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` } // UpdateEnterpriseRunnerGroupRequest represents a request to update a Runner group for an enterprise. @@ -60,6 +64,7 @@ type UpdateEnterpriseRunnerGroupRequest struct { AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` SelectedWorkflows []string `json:"selected_workflows,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` } // SetOrgAccessRunnerGroupRequest represents a request to replace the list of organizations @@ -79,7 +84,7 @@ type ListEnterpriseRunnerGroupOptions struct { // ListRunnerGroups lists all self-hosted runner groups configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) { @@ -94,7 +99,7 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str return nil, nil, err } - groups := &EnterpriseRunnerGroups{} + var groups *EnterpriseRunnerGroups resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err @@ -105,7 +110,7 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str // GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) { @@ -115,8 +120,8 @@ func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterp return nil, nil, err } - runnerGroup := new(EnterpriseRunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *EnterpriseRunnerGroup + resp, err := s.client.Do(ctx, req, &runnerGroup) if err != nil { return nil, resp, err } @@ -126,7 +131,7 @@ func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterp // DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) { @@ -142,7 +147,7 @@ func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, ent // CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { @@ -152,8 +157,8 @@ func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, ent return nil, nil, err } - runnerGroup := new(EnterpriseRunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *EnterpriseRunnerGroup + resp, err := s.client.Do(ctx, req, &runnerGroup) if err != nil { return nil, resp, err } @@ -163,7 +168,7 @@ func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, ent // UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { @@ -173,8 +178,8 @@ func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, ent return nil, nil, err } - runnerGroup := new(EnterpriseRunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *EnterpriseRunnerGroup + resp, err := s.client.Do(ctx, req, &runnerGroup) if err != nil { return nil, resp, err } @@ -184,7 +189,7 @@ func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, ent // ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) { @@ -199,7 +204,7 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex return nil, nil, err } - orgs := &ListOrganizations{} + var orgs *ListOrganizations resp, err := s.client.Do(ctx, req, &orgs) if err != nil { return nil, resp, err @@ -211,7 +216,7 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex // SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise // with a new List of organizations. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) { @@ -228,7 +233,7 @@ func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context // AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { @@ -245,7 +250,7 @@ func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context // RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { @@ -261,7 +266,7 @@ func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Cont // ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { @@ -276,7 +281,7 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri return nil, nil, err } - runners := &Runners{} + var runners *Runners resp, err := s.client.Do(ctx, req, &runners) if err != nil { return nil, resp, err @@ -288,7 +293,7 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { @@ -304,7 +309,7 @@ func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterpris // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { @@ -321,7 +326,7 @@ func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterpris // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v85/github/enterprise_actions_runners.go similarity index 81% rename from vendor/github.com/google/go-github/v82/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v85/github/enterprise_actions_runners.go index 408dcfd84..154997b88 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_actions_runners.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_actions_runners.go @@ -12,7 +12,7 @@ import ( // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners/downloads func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { @@ -33,7 +33,7 @@ func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, // GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/actions/runners/generate-jitconfig func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { @@ -44,8 +44,8 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent return nil, nil, err } - jitConfig := new(JITRunnerConfig) - resp, err := s.client.Do(ctx, req, jitConfig) + var jitConfig *JITRunnerConfig + resp, err := s.client.Do(ctx, req, &jitConfig) if err != nil { return nil, resp, err } @@ -55,7 +55,7 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/actions/runners/registration-token func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { @@ -66,8 +66,8 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr return nil, nil, err } - registrationToken := new(RegistrationToken) - resp, err := s.client.Do(ctx, req, registrationToken) + var registrationToken *RegistrationToken + resp, err := s.client.Do(ctx, req, ®istrationToken) if err != nil { return nil, resp, err } @@ -77,7 +77,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListRunnersOptions) (*Runners, *Response, error) { @@ -92,7 +92,7 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, return nil, nil, err } - runners := &Runners{} + var runners *Runners resp, err := s.client.Do(ctx, req, &runners) if err != nil { return nil, resp, err @@ -103,7 +103,7 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // GetRunner gets a specific self-hosted runner configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners/{runner_id} func (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, runnerID int64) (*Runner, *Response, error) { @@ -113,8 +113,8 @@ func (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, ru return nil, nil, err } - runner := new(Runner) - resp, err := s.client.Do(ctx, req, runner) + var runner *Runner + resp, err := s.client.Do(ctx, req, &runner) if err != nil { return nil, resp, err } @@ -124,7 +124,7 @@ func (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, ru // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runners/{runner_id} func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_app_installation.go b/vendor/github.com/google/go-github/v85/github/enterprise_app_installation.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/enterprise_app_installation.go rename to vendor/github.com/google/go-github/v85/github/enterprise_app_installation.go index aed3ac753..6088507bf 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_app_installation.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_app_installation.go @@ -37,7 +37,7 @@ type InstallAppRequest struct { // ListAppInstallableOrganizations lists the organizations in an enterprise that are installable for an app. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-enterprise-owned-organizations-that-can-have-github-apps-installed +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#get-enterprise-owned-organizations-that-can-have-github-apps-installed // //meta:operation GET /enterprises/{enterprise}/apps/installable_organizations func (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, enterprise string, opts *ListOptions) ([]*InstallableOrganization, *Response, error) { @@ -64,7 +64,7 @@ func (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, // ListAppAccessibleOrganizationRepositories lists the repositories accessible to an app in an enterprise-owned organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-repositories-belonging-to-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#get-repositories-belonging-to-an-enterprise-owned-organization // //meta:operation GET /enterprises/{enterprise}/apps/installable_organizations/{org}/accessible_repositories func (s *EnterpriseService) ListAppAccessibleOrganizationRepositories(ctx context.Context, enterprise, org string, opts *ListOptions) ([]*AccessibleRepository, *Response, error) { @@ -91,7 +91,7 @@ func (s *EnterpriseService) ListAppAccessibleOrganizationRepositories(ctx contex // ListAppInstallations lists the GitHub app installations associated with the given enterprise-owned organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#list-github-apps-installed-on-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#list-github-apps-installed-on-an-enterprise-owned-organization // //meta:operation GET /enterprises/{enterprise}/apps/organizations/{org}/installations func (s *EnterpriseService) ListAppInstallations(ctx context.Context, enterprise, org string, opts *ListOptions) ([]*Installation, *Response, error) { @@ -119,7 +119,7 @@ func (s *EnterpriseService) ListAppInstallations(ctx context.Context, enterprise // InstallApp installs any valid GitHub app on the specified organization owned by the enterprise. // If the app is already installed on the organization, and is suspended, it will be unsuspended. If the app has a pending installation request, they will all be approved. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#install-a-github-app-on-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#install-a-github-app-on-an-enterprise-owned-organization // //meta:operation POST /enterprises/{enterprise}/apps/organizations/{org}/installations func (s *EnterpriseService) InstallApp(ctx context.Context, enterprise, org string, request InstallAppRequest) (*Installation, *Response, error) { @@ -140,7 +140,7 @@ func (s *EnterpriseService) InstallApp(ctx context.Context, enterprise, org stri // UninstallApp uninstalls a GitHub app from an organization. Any app installed on the organization can be removed. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#uninstall-a-github-app-from-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#uninstall-a-github-app-from-an-enterprise-owned-organization // //meta:operation DELETE /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id} func (s *EnterpriseService) UninstallApp(ctx context.Context, enterprise, org string, installationID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_apps.go b/vendor/github.com/google/go-github/v85/github/enterprise_apps.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/enterprise_apps.go rename to vendor/github.com/google/go-github/v85/github/enterprise_apps.go index 3fc0df743..9d46fc273 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_apps.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_apps.go @@ -27,7 +27,7 @@ type UpdateAppInstallationRepositoriesOptions struct { // ListRepositoriesForOrgAppInstallation lists the repositories that an enterprise app installation // has access to on an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-the-repositories-accessible-to-a-given-github-app-installation +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#get-the-repositories-accessible-to-a-given-github-app-installation // //meta:operation GET /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories func (s *EnterpriseService) ListRepositoriesForOrgAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts *ListOptions) ([]*AccessibleRepository, *Response, error) { @@ -54,7 +54,7 @@ func (s *EnterpriseService) ListRepositoriesForOrgAppInstallation(ctx context.Co // UpdateAppInstallationRepositories changes a GitHub App installation's repository access // between all repositories and a selected set. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#toggle-installation-repository-access-between-selected-and-all-repositories +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#toggle-installation-repository-access-between-selected-and-all-repositories // //meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories func (s *EnterpriseService) UpdateAppInstallationRepositories(ctx context.Context, enterprise, org string, installationID int64, opts UpdateAppInstallationRepositoriesOptions) (*Installation, *Response, error) { @@ -75,7 +75,7 @@ func (s *EnterpriseService) UpdateAppInstallationRepositories(ctx context.Contex // AddRepositoriesToAppInstallation grants repository access for a GitHub App installation. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#grant-repository-access-to-an-organization-installation +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#grant-repository-access-to-an-organization-installation // //meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/add func (s *EnterpriseService) AddRepositoriesToAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts AppInstallationRepositoriesOptions) ([]*AccessibleRepository, *Response, error) { @@ -96,7 +96,7 @@ func (s *EnterpriseService) AddRepositoriesToAppInstallation(ctx context.Context // RemoveRepositoriesFromAppInstallation revokes repository access from a GitHub App installation. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#remove-repository-access-from-an-organization-installation +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#remove-repository-access-from-an-organization-installation // //meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/remove func (s *EnterpriseService) RemoveRepositoriesFromAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts AppInstallationRepositoriesOptions) ([]*AccessibleRepository, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v85/github/enterprise_audit_log.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v85/github/enterprise_audit_log.go index 058a7d177..8efdb77b1 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_audit_log.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_audit_log.go @@ -12,7 +12,7 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#get-the-audit-log-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/audit-log func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { diff --git a/vendor/github.com/google/go-github/v85/github/enterprise_audit_log_stream.go b/vendor/github.com/google/go-github/v85/github/enterprise_audit_log_stream.go new file mode 100644 index 000000000..bdb4f2386 --- /dev/null +++ b/vendor/github.com/google/go-github/v85/github/enterprise_audit_log_stream.go @@ -0,0 +1,287 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// AuditLogStream represents an audit log stream configuration for an enterprise. +type AuditLogStream struct { + ID int64 `json:"id"` + StreamType string `json:"stream_type"` + StreamDetails string `json:"stream_details"` + Enabled bool `json:"enabled"` + CreatedAt Timestamp `json:"created_at"` + UpdatedAt Timestamp `json:"updated_at"` + PausedAt *Timestamp `json:"paused_at,omitempty"` +} + +// AuditLogStreamConfig represents a configuration for creating or updating an audit log stream. +type AuditLogStreamConfig struct { + Enabled bool `json:"enabled"` + StreamType string `json:"stream_type"` + VendorSpecific AuditLogStreamVendorConfig `json:"vendor_specific"` +} + +// AuditLogStreamVendorConfig is a sealed marker interface for vendor-specific audit log +// stream configurations. Only this package can define implementations. +type AuditLogStreamVendorConfig interface { + isAuditLogStreamVendorConfig() +} + +// AuditLogStreamKey represents the public key used to encrypt secrets for audit log streaming. +type AuditLogStreamKey struct { + KeyID string `json:"key_id"` + Key string `json:"key"` +} + +// AzureBlobConfig represents vendor-specific config for Azure Blob Storage. +type AzureBlobConfig struct { + KeyID string `json:"key_id"` + EncryptedSASURL string `json:"encrypted_sas_url"` + Container string `json:"container"` +} + +// AzureHubConfig represents vendor-specific config for Azure Event Hubs. +type AzureHubConfig struct { + Name string `json:"name"` + EncryptedConnstring string `json:"encrypted_connstring"` + KeyID string `json:"key_id"` +} + +// AmazonS3OIDCConfig represents vendor-specific config for Amazon S3 with OIDC authentication. +type AmazonS3OIDCConfig struct { + Bucket string `json:"bucket"` + Region string `json:"region"` + KeyID string `json:"key_id"` + AuthenticationType string `json:"authentication_type"` // Value: "oidc" + ArnRole string `json:"arn_role"` +} + +// AmazonS3AccessKeysConfig represents vendor-specific config for Amazon S3 with access key authentication. +type AmazonS3AccessKeysConfig struct { + Bucket string `json:"bucket"` + Region string `json:"region"` + KeyID string `json:"key_id"` + AuthenticationType string `json:"authentication_type"` // Value: "access_keys" + EncryptedSecretKey string `json:"encrypted_secret_key"` + EncryptedAccessKeyID string `json:"encrypted_access_key_id"` +} + +// SplunkConfig represents vendor-specific config for Splunk. +type SplunkConfig struct { + Domain string `json:"domain"` + Port uint16 `json:"port"` + KeyID string `json:"key_id"` + EncryptedToken string `json:"encrypted_token"` + SSLVerify bool `json:"ssl_verify"` +} + +// HecConfig represents vendor-specific config for an HTTPS Event Collector (HEC) endpoint. +type HecConfig struct { + Domain string `json:"domain"` + Port uint16 `json:"port"` + KeyID string `json:"key_id"` + EncryptedToken string `json:"encrypted_token"` + Path string `json:"path"` + SSLVerify bool `json:"ssl_verify"` +} + +// GoogleCloudConfig represents vendor-specific config for Google Cloud Storage. +type GoogleCloudConfig struct { + Bucket string `json:"bucket"` + KeyID string `json:"key_id"` + EncryptedJSONCredentials string `json:"encrypted_json_credentials"` +} + +// DatadogConfig represents vendor-specific config for Datadog. +type DatadogConfig struct { + EncryptedToken string `json:"encrypted_token"` + Site string `json:"site"` // One of: US, US3, US5, EU1, US1-FED, AP1 + KeyID string `json:"key_id"` +} + +// Implement the sealed marker interface for all vendor config types. +func (*AzureBlobConfig) isAuditLogStreamVendorConfig() {} +func (*AzureHubConfig) isAuditLogStreamVendorConfig() {} +func (*AmazonS3OIDCConfig) isAuditLogStreamVendorConfig() {} +func (*AmazonS3AccessKeysConfig) isAuditLogStreamVendorConfig() {} +func (*SplunkConfig) isAuditLogStreamVendorConfig() {} +func (*HecConfig) isAuditLogStreamVendorConfig() {} +func (*GoogleCloudConfig) isAuditLogStreamVendorConfig() {} +func (*DatadogConfig) isAuditLogStreamVendorConfig() {} + +// NewAzureBlobStreamConfig returns an AuditLogStreamConfig for Azure Blob Storage. +func NewAzureBlobStreamConfig(enabled bool, cfg *AzureBlobConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Azure Blob Storage", VendorSpecific: cfg} +} + +// NewAzureHubStreamConfig returns an AuditLogStreamConfig for Azure Event Hubs. +func NewAzureHubStreamConfig(enabled bool, cfg *AzureHubConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Azure Event Hubs", VendorSpecific: cfg} +} + +// NewAmazonS3OIDCStreamConfig returns an AuditLogStreamConfig for Amazon S3 with OIDC auth. +func NewAmazonS3OIDCStreamConfig(enabled bool, cfg *AmazonS3OIDCConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Amazon S3", VendorSpecific: cfg} +} + +// NewAmazonS3AccessKeysStreamConfig returns an AuditLogStreamConfig for Amazon S3 with access key auth. +func NewAmazonS3AccessKeysStreamConfig(enabled bool, cfg *AmazonS3AccessKeysConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Amazon S3", VendorSpecific: cfg} +} + +// NewSplunkStreamConfig returns an AuditLogStreamConfig for Splunk. +func NewSplunkStreamConfig(enabled bool, cfg *SplunkConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Splunk", VendorSpecific: cfg} +} + +// NewHecStreamConfig returns an AuditLogStreamConfig for an HTTPS Event Collector endpoint. +func NewHecStreamConfig(enabled bool, cfg *HecConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "HTTPS Event Collector", VendorSpecific: cfg} +} + +// NewGoogleCloudStreamConfig returns an AuditLogStreamConfig for Google Cloud Storage. +func NewGoogleCloudStreamConfig(enabled bool, cfg *GoogleCloudConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Google Cloud Storage", VendorSpecific: cfg} +} + +// NewDatadogStreamConfig returns an AuditLogStreamConfig for Datadog. +func NewDatadogStreamConfig(enabled bool, cfg *DatadogConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Datadog", VendorSpecific: cfg} +} + +// GetAuditLogStreamKey retrieves the public key used to encrypt secrets for audit log streaming. +// Credentials must be encrypted with this key before being submitted via CreateAuditLogStream +// or UpdateAuditLogStream. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#get-the-audit-log-stream-key-for-encrypting-secrets +// +//meta:operation GET /enterprises/{enterprise}/audit-log/stream-key +func (s *EnterpriseService) GetAuditLogStreamKey(ctx context.Context, enterprise string) (*AuditLogStreamKey, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/stream-key", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var key *AuditLogStreamKey + resp, err := s.client.Do(ctx, req, &key) + if err != nil { + return nil, resp, err + } + + return key, resp, nil +} + +// ListAuditLogStreams lists the audit log stream configurations for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#list-audit-log-stream-configurations-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/audit-log/streams +func (s *EnterpriseService) ListAuditLogStreams(ctx context.Context, enterprise string) ([]*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var streams []*AuditLogStream + resp, err := s.client.Do(ctx, req, &streams) + if err != nil { + return nil, resp, err + } + + return streams, resp, nil +} + +// GetAuditLogStream gets a single audit log stream configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#list-one-audit-log-streaming-configuration-via-a-stream-id +// +//meta:operation GET /enterprises/{enterprise}/audit-log/streams/{stream_id} +func (s *EnterpriseService) GetAuditLogStream(ctx context.Context, enterprise string, streamID int64) (*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams/%v", enterprise, streamID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var stream *AuditLogStream + resp, err := s.client.Do(ctx, req, &stream) + if err != nil { + return nil, resp, err + } + + return stream, resp, nil +} + +// CreateAuditLogStream creates an audit log streaming configuration for an enterprise. +// Credentials in the config must be encrypted using the key returned by GetAuditLogStreamKey. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#create-an-audit-log-streaming-configuration-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/audit-log/streams +func (s *EnterpriseService) CreateAuditLogStream(ctx context.Context, enterprise string, config AuditLogStreamConfig) (*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams", enterprise) + + req, err := s.client.NewRequest("POST", u, config) + if err != nil { + return nil, nil, err + } + + var stream *AuditLogStream + resp, err := s.client.Do(ctx, req, &stream) + if err != nil { + return nil, resp, err + } + + return stream, resp, nil +} + +// UpdateAuditLogStream updates an existing audit log stream configuration for an enterprise. +// Credentials in the config must be encrypted using the key returned by GetAuditLogStreamKey. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#update-an-existing-audit-log-stream-configuration +// +//meta:operation PUT /enterprises/{enterprise}/audit-log/streams/{stream_id} +func (s *EnterpriseService) UpdateAuditLogStream(ctx context.Context, enterprise string, streamID int64, config AuditLogStreamConfig) (*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams/%v", enterprise, streamID) + + req, err := s.client.NewRequest("PUT", u, config) + if err != nil { + return nil, nil, err + } + + var stream *AuditLogStream + resp, err := s.client.Do(ctx, req, &stream) + if err != nil { + return nil, resp, err + } + + return stream, resp, nil +} + +// DeleteAuditLogStream deletes an audit log stream configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#delete-an-audit-log-streaming-configuration-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id} +func (s *EnterpriseService) DeleteAuditLogStream(ctx context.Context, enterprise string, streamID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams/%v", enterprise, streamID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_billing_cost_centers.go b/vendor/github.com/google/go-github/v85/github/enterprise_billing_cost_centers.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/enterprise_billing_cost_centers.go rename to vendor/github.com/google/go-github/v85/github/enterprise_billing_cost_centers.go index 3cc3279da..0d55bd978 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_billing_cost_centers.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_billing_cost_centers.go @@ -76,7 +76,7 @@ type DeleteCostCenterResponse struct { // ListCostCenters lists all cost centers for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-all-cost-centers-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#get-all-cost-centers-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise string, opts *ListCostCenterOptions) (*CostCenters, *Response, error) { @@ -91,8 +91,8 @@ func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise stri return nil, nil, err } - costCenters := &CostCenters{} - resp, err := s.client.Do(ctx, req, costCenters) + var costCenters *CostCenters + resp, err := s.client.Do(ctx, req, &costCenters) if err != nil { return nil, resp, err } @@ -102,7 +102,7 @@ func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise stri // CreateCostCenter creates a new cost center for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#create-a-new-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#create-a-new-cost-center // //meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise string, costCenter CostCenterRequest) (*CostCenter, *Response, error) { @@ -113,8 +113,8 @@ func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise str return nil, nil, err } - result := &CostCenter{} - resp, err := s.client.Do(ctx, req, result) + var result *CostCenter + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -124,7 +124,7 @@ func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise str // GetCostCenter gets a cost center by ID for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-a-cost-center-by-id +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#get-a-cost-center-by-id // //meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id} func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costCenterID string) (*CostCenter, *Response, error) { @@ -135,8 +135,8 @@ func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costC return nil, nil, err } - costCenter := &CostCenter{} - resp, err := s.client.Do(ctx, req, costCenter) + var costCenter *CostCenter + resp, err := s.client.Do(ctx, req, &costCenter) if err != nil { return nil, resp, err } @@ -146,7 +146,7 @@ func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costC // UpdateCostCenter updates the name of a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#update-a-cost-center-name +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#update-a-cost-center-name // //meta:operation PATCH /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id} func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, costCenterID string, costCenter CostCenterRequest) (*CostCenter, *Response, error) { @@ -157,8 +157,8 @@ func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, co return nil, nil, err } - result := &CostCenter{} - resp, err := s.client.Do(ctx, req, result) + var result *CostCenter + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -168,7 +168,7 @@ func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, co // DeleteCostCenter deletes a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#delete-a-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#delete-a-cost-center // //meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id} func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, costCenterID string) (*DeleteCostCenterResponse, *Response, error) { @@ -179,8 +179,8 @@ func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, co return nil, nil, err } - result := &DeleteCostCenterResponse{} - resp, err := s.client.Do(ctx, req, result) + var result *DeleteCostCenterResponse + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -190,7 +190,7 @@ func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, co // AddResourcesToCostCenter adds resources to a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#add-resources-to-a-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#add-resources-to-a-cost-center // //meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*AddResourcesToCostCenterResponse, *Response, error) { @@ -201,8 +201,8 @@ func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterp return nil, nil, err } - result := &AddResourcesToCostCenterResponse{} - resp, err := s.client.Do(ctx, req, result) + var result *AddResourcesToCostCenterResponse + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } @@ -212,7 +212,7 @@ func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterp // RemoveResourcesFromCostCenter removes resources from a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#remove-resources-from-a-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#remove-resources-from-a-cost-center // //meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource func (s *EnterpriseService) RemoveResourcesFromCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*RemoveResourcesFromCostCenterResponse, *Response, error) { @@ -223,8 +223,8 @@ func (s *EnterpriseService) RemoveResourcesFromCostCenter(ctx context.Context, e return nil, nil, err } - result := &RemoveResourcesFromCostCenterResponse{} - resp, err := s.client.Do(ctx, req, result) + var result *RemoveResourcesFromCostCenterResponse + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v85/github/enterprise_budgets.go b/vendor/github.com/google/go-github/v85/github/enterprise_budgets.go new file mode 100644 index 000000000..6892df132 --- /dev/null +++ b/vendor/github.com/google/go-github/v85/github/enterprise_budgets.go @@ -0,0 +1,198 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// BudgetScope constants represent the scope of the budget. +const ( + BudgetScopeEnterprise = "enterprise" + BudgetScopeOrganization = "organization" + BudgetScopeRepository = "repository" + BudgetScopeCostCenter = "cost_center" +) + +// BudgetType constants represent the type of pricing for the budget. +const ( + BudgetTypeProductPricing = "ProductPricing" + BudgetTypeSkuPricing = "SkuPricing" +) + +// EnterpriseBudgetAlerting represents alerting settings for a GitHub enterprise budget. +type EnterpriseBudgetAlerting struct { + WillAlert *bool `json:"will_alert,omitempty"` + AlertRecipients []string `json:"alert_recipients,omitempty"` +} + +// EnterpriseBudget represents a GitHub enterprise budget. +type EnterpriseBudget struct { + ID *string `json:"id,omitempty"` + BudgetType *string `json:"budget_type,omitempty"` + BudgetProductSKU *string `json:"budget_product_sku,omitempty"` + BudgetScope *string `json:"budget_scope,omitempty"` + BudgetEntityName *string `json:"budget_entity_name,omitempty"` + BudgetAmount *int `json:"budget_amount,omitempty"` + PreventFurtherUsage *bool `json:"prevent_further_usage,omitempty"` + BudgetAlerting *EnterpriseBudgetAlerting `json:"budget_alerting,omitempty"` +} + +func (b EnterpriseBudget) String() string { + return Stringify(b) +} + +// EnterpriseListBudgets represents a collection of GitHub enterprise budgets. +type EnterpriseListBudgets struct { + Budgets []*EnterpriseBudget `json:"budgets"` + HasNextPage *bool `json:"has_next_page,omitempty"` + TotalCount *int `json:"total_count,omitempty"` +} + +// EnterpriseCreateBudget represents the payload to create a GitHub enterprise budget. +type EnterpriseCreateBudget struct { + BudgetAmount int `json:"budget_amount"` + PreventFurtherUsage bool `json:"prevent_further_usage"` + BudgetAlerting *EnterpriseBudgetAlerting `json:"budget_alerting"` + BudgetScope string `json:"budget_scope"` + BudgetEntityName *string `json:"budget_entity_name,omitempty"` + BudgetType string `json:"budget_type"` + BudgetProductSKU *string `json:"budget_product_sku,omitempty"` +} + +// EnterpriseUpdateBudget represents the payload to update a GitHub enterprise budget. +type EnterpriseUpdateBudget struct { + BudgetAmount *int `json:"budget_amount,omitempty"` + PreventFurtherUsage *bool `json:"prevent_further_usage,omitempty"` + BudgetAlerting *EnterpriseBudgetAlerting `json:"budget_alerting,omitempty"` + BudgetScope *string `json:"budget_scope,omitempty"` + BudgetEntityName *string `json:"budget_entity_name,omitempty"` + BudgetType *string `json:"budget_type,omitempty"` + BudgetProductSKU *string `json:"budget_product_sku,omitempty"` +} + +// EnterpriseCreateOrUpdateBudgetResponse represents the response when creating or updating a budget. +type EnterpriseCreateOrUpdateBudgetResponse struct { + Message string `json:"message"` + Budget *EnterpriseBudget `json:"budget"` +} + +// EnterpriseDeleteBudgetResponse represents the response when deleting a budget. +type EnterpriseDeleteBudgetResponse struct { + Message string `json:"message"` + ID string `json:"id"` +} + +// ListBudgets gets all budgets for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#get-all-budgets +// +//meta:operation GET /enterprises/{enterprise}/settings/billing/budgets +func (s *EnterpriseService) ListBudgets(ctx context.Context, enterprise string) (*EnterpriseListBudgets, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var budgets *EnterpriseListBudgets + resp, err := s.client.Do(ctx, req, &budgets) + if err != nil { + return nil, resp, err + } + + return budgets, resp, nil +} + +// CreateBudget creates a new budget for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#create-a-budget +// +//meta:operation POST /enterprises/{enterprise}/settings/billing/budgets +func (s *EnterpriseService) CreateBudget(ctx context.Context, enterprise string, budget EnterpriseCreateBudget) (*EnterpriseCreateOrUpdateBudgetResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets", enterprise) + + req, err := s.client.NewRequest("POST", u, budget) + if err != nil { + return nil, nil, err + } + + var createBudgetResponse *EnterpriseCreateOrUpdateBudgetResponse + resp, err := s.client.Do(ctx, req, &createBudgetResponse) + if err != nil { + return nil, resp, err + } + + return createBudgetResponse, resp, nil +} + +// GetBudget gets a budget by ID for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#get-a-budget-by-id +// +//meta:operation GET /enterprises/{enterprise}/settings/billing/budgets/{budget_id} +func (s *EnterpriseService) GetBudget(ctx context.Context, enterprise, budgetID string) (*EnterpriseBudget, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets/%v", enterprise, budgetID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var budget *EnterpriseBudget + resp, err := s.client.Do(ctx, req, &budget) + if err != nil { + return nil, resp, err + } + + return budget, resp, nil +} + +// UpdateBudget updates an existing budget for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#update-a-budget +// +//meta:operation PATCH /enterprises/{enterprise}/settings/billing/budgets/{budget_id} +func (s *EnterpriseService) UpdateBudget(ctx context.Context, enterprise, budgetID string, budget EnterpriseUpdateBudget) (*EnterpriseCreateOrUpdateBudgetResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets/%v", enterprise, budgetID) + + req, err := s.client.NewRequest("PATCH", u, budget) + if err != nil { + return nil, nil, err + } + + var updateBudgetResponse *EnterpriseCreateOrUpdateBudgetResponse + resp, err := s.client.Do(ctx, req, &updateBudgetResponse) + if err != nil { + return nil, resp, err + } + + return updateBudgetResponse, resp, nil +} + +// DeleteBudget deletes a budget by ID for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#delete-a-budget +// +//meta:operation DELETE /enterprises/{enterprise}/settings/billing/budgets/{budget_id} +func (s *EnterpriseService) DeleteBudget(ctx context.Context, enterprise, budgetID string) (*EnterpriseDeleteBudgetResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets/%v", enterprise, budgetID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + var deleteBudgetResponse *EnterpriseDeleteBudgetResponse + resp, err := s.client.Do(ctx, req, &deleteBudgetResponse) + if err != nil { + return nil, resp, err + } + + return deleteBudgetResponse, resp, nil +} diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_code_security_and_analysis.go b/vendor/github.com/google/go-github/v85/github/enterprise_code_security_and_analysis.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/enterprise_code_security_and_analysis.go rename to vendor/github.com/google/go-github/v85/github/enterprise_code_security_and_analysis.go index 159aeae4d..09e27311b 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_code_security_and_analysis.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_code_security_and_analysis.go @@ -21,7 +21,7 @@ type EnterpriseSecurityAnalysisSettings struct { // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { @@ -32,8 +32,8 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente return nil, nil, err } - settings := new(EnterpriseSecurityAnalysisSettings) - resp, err := s.client.Do(ctx, req, settings) + var settings *EnterpriseSecurityAnalysisSettings + resp, err := s.client.Do(ctx, req, &settings) if err != nil { return nil, resp, err } @@ -43,7 +43,7 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente // UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { @@ -66,7 +66,7 @@ func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, e // Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection". // Valid values for enablement: "enable_all", "disable_all". // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature // //meta:operation POST /enterprises/{enterprise}/{security_product}/{enablement} func (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_codesecurity_configurations.go b/vendor/github.com/google/go-github/v85/github/enterprise_codesecurity_configurations.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/enterprise_codesecurity_configurations.go rename to vendor/github.com/google/go-github/v85/github/enterprise_codesecurity_configurations.go index 687873dec..1b5313c90 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_codesecurity_configurations.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_codesecurity_configurations.go @@ -21,18 +21,18 @@ import ( // per page (max 100 per GitHub API docs). type ListEnterpriseCodeSecurityConfigurationOptions struct { // A cursor, as given in the Link header. If specified, the query only searches for security configurations before this cursor. - Before *string `url:"before,omitempty"` + Before string `url:"before,omitempty"` // A cursor, as given in the Link header. If specified, the query only searches for security configurations after this cursor. - After *string `url:"after,omitempty"` + After string `url:"after,omitempty"` // For paginated result sets, the number of results to include per page. - PerPage *int `url:"per_page,omitempty"` + PerPage int `url:"per_page,omitempty"` } // ListCodeSecurityConfigurations lists all code security configurations available in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-code-security-configurations-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code-security/configurations func (s *EnterpriseService) ListCodeSecurityConfigurations(ctx context.Context, enterprise string, opts *ListEnterpriseCodeSecurityConfigurationOptions) ([]*CodeSecurityConfiguration, *Response, error) { @@ -57,7 +57,7 @@ func (s *EnterpriseService) ListCodeSecurityConfigurations(ctx context.Context, // CreateCodeSecurityConfiguration creates a code security configuration in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#create-a-code-security-configuration-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/code-security/configurations func (s *EnterpriseService) CreateCodeSecurityConfiguration(ctx context.Context, enterprise string, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { @@ -78,7 +78,7 @@ func (s *EnterpriseService) CreateCodeSecurityConfiguration(ctx context.Context, // ListDefaultCodeSecurityConfigurations lists the default code security configurations for an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-default-code-security-configurations-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code-security/configurations/defaults func (s *EnterpriseService) ListDefaultCodeSecurityConfigurations(ctx context.Context, enterprise string) ([]*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { @@ -99,7 +99,7 @@ func (s *EnterpriseService) ListDefaultCodeSecurityConfigurations(ctx context.Co // GetCodeSecurityConfiguration gets a code security configuration available in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#retrieve-a-code-security-configuration-of-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code-security/configurations/{configuration_id} func (s *EnterpriseService) GetCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64) (*CodeSecurityConfiguration, *Response, error) { @@ -120,7 +120,7 @@ func (s *EnterpriseService) GetCodeSecurityConfiguration(ctx context.Context, en // UpdateCodeSecurityConfiguration updates a code security configuration in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#update-a-custom-code-security-configuration-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id} func (s *EnterpriseService) UpdateCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { @@ -141,7 +141,7 @@ func (s *EnterpriseService) UpdateCodeSecurityConfiguration(ctx context.Context, // DeleteCodeSecurityConfiguration deletes a code security configuration from an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#delete-a-code-security-configuration-for-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id} func (s *EnterpriseService) DeleteCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64) (*Response, error) { @@ -162,7 +162,7 @@ func (s *EnterpriseService) DeleteCodeSecurityConfiguration(ctx context.Context, // `scope` is the type of repositories to attach the configuration to. // Can be one of: `all`, `all_without_configurations`. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#attach-an-enterprise-configuration-to-repositories // //meta:operation POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach func (s *EnterpriseService) AttachCodeSecurityConfigurationToRepositories(ctx context.Context, enterprise string, configurationID int64, scope string) (*Response, error) { @@ -186,7 +186,7 @@ func (s *EnterpriseService) AttachCodeSecurityConfigurationToRepositories(ctx co // `defaultForNewRepos` specifies which types of repository this security configuration should be applied to by default. // Can be one of: `all`, `none`, `private_and_internal`, `public`. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#set-a-code-security-configuration-as-a-default-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults func (s *EnterpriseService) SetDefaultCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64, defaultForNewRepos string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { @@ -209,7 +209,7 @@ func (s *EnterpriseService) SetDefaultCodeSecurityConfiguration(ctx context.Cont // ListCodeSecurityConfigurationRepositories lists the repositories associated with an enterprise code security configuration. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-repositories-associated-with-an-enterprise-code-security-configuration // //meta:operation GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories func (s *EnterpriseService) ListCodeSecurityConfigurationRepositories(ctx context.Context, enterprise string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) ([]*RepositoryAttachment, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_licenses.go b/vendor/github.com/google/go-github/v85/github/enterprise_licenses.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/enterprise_licenses.go rename to vendor/github.com/google/go-github/v85/github/enterprise_licenses.go index e58fc07c6..2fef2aa5b 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_licenses.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_licenses.go @@ -91,7 +91,7 @@ type LastLicenseSyncProperties struct { // GetConsumedLicenses collect information about the number of consumed licenses and a collection with all the users with consumed enterprise licenses. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing#list-enterprise-consumed-licenses +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing?apiVersion=2022-11-28#list-enterprise-consumed-licenses // //meta:operation GET /enterprises/{enterprise}/consumed-licenses func (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise string, opts *ListOptions) (*EnterpriseConsumedLicenses, *Response, error) { @@ -106,7 +106,7 @@ func (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise return nil, nil, err } - consumedLicenses := &EnterpriseConsumedLicenses{} + var consumedLicenses *EnterpriseConsumedLicenses resp, err := s.client.Do(ctx, req, &consumedLicenses) if err != nil { return nil, resp, err @@ -117,7 +117,7 @@ func (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise // GetLicenseSyncStatus collects information about the status of a license sync job for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing#get-a-license-sync-status +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing?apiVersion=2022-11-28#get-a-license-sync-status // //meta:operation GET /enterprises/{enterprise}/license-sync-status func (s *EnterpriseService) GetLicenseSyncStatus(ctx context.Context, enterprise string) (*EnterpriseLicenseSyncStatus, *Response, error) { @@ -128,7 +128,7 @@ func (s *EnterpriseService) GetLicenseSyncStatus(ctx context.Context, enterprise return nil, nil, err } - syncStatus := &EnterpriseLicenseSyncStatus{} + var syncStatus *EnterpriseLicenseSyncStatus resp, err := s.client.Do(ctx, req, &syncStatus) if err != nil { return nil, resp, err diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes.go b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes.go rename to vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes.go index 60fe302ee..7efb47f52 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes.go @@ -74,7 +74,7 @@ type ReleaseVersion struct { // CheckSystemRequirements checks if GHES system nodes meet the system requirements. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes // //meta:operation GET /manage/v1/checks/system-requirements func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) { @@ -84,8 +84,8 @@ func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*Syste return nil, nil, err } - systemRequirements := new(SystemRequirements) - resp, err := s.client.Do(ctx, req, systemRequirements) + var systemRequirements *SystemRequirements + resp, err := s.client.Do(ctx, req, &systemRequirements) if err != nil { return nil, resp, err } @@ -95,7 +95,7 @@ func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*Syste // ClusterStatus gets the status of all services running on each cluster node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes // //meta:operation GET /manage/v1/cluster/status func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) { @@ -105,8 +105,8 @@ func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, return nil, nil, err } - clusterStatus := new(ClusterStatus) - resp, err := s.client.Do(ctx, req, clusterStatus) + var clusterStatus *ClusterStatus + resp, err := s.client.Do(ctx, req, &clusterStatus) if err != nil { return nil, resp, err } @@ -116,7 +116,7 @@ func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, // ReplicationStatus gets the status of all services running on each replica node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes // //meta:operation GET /manage/v1/replication/status func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) { @@ -129,8 +129,8 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue return nil, nil, err } - status := new(ClusterStatus) - resp, err := s.client.Do(ctx, req, status) + var status *ClusterStatus + resp, err := s.client.Do(ctx, req, &status) if err != nil { return nil, resp, err } @@ -140,7 +140,7 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue // GetNodeReleaseVersions gets the version information deployed to each node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes // //meta:operation GET /manage/v1/version func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_config.go b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_config.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_config.go rename to vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_config.go index c6c7a3f35..a20bc1abd 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_config.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_config.go @@ -305,7 +305,7 @@ type NodeDetails struct { // ConfigApplyEvents gets events from the command ghe-config-apply. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply // //meta:operation GET /manage/v1/config/apply/events func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) { @@ -318,8 +318,8 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA return nil, nil, err } - configApplyEvents := new(ConfigApplyEvents) - resp, err := s.client.Do(ctx, req, configApplyEvents) + var configApplyEvents *ConfigApplyEvents + resp, err := s.client.Do(ctx, req, &configApplyEvents) if err != nil { return nil, resp, err } @@ -330,7 +330,7 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA // InitialConfig initializes the GitHub Enterprise instance with a license and password. // After initializing the instance, you need to run an apply to apply the configuration. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password // //meta:operation POST /manage/v1/config/init func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) { @@ -351,7 +351,7 @@ func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password // License gets the current license information for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information // //meta:operation GET /manage/v1/config/license func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) { @@ -372,7 +372,7 @@ func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Res // UploadLicense uploads a new license to the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license // //meta:operation PUT /manage/v1/config/license func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) { @@ -390,7 +390,7 @@ func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) ( // LicenseStatus gets the current license status for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#check-a-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#check-a-license // //meta:operation GET /manage/v1/config/license/check func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) { @@ -412,7 +412,7 @@ func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, // NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance. // This is required for clustered setups. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes // //meta:operation GET /manage/v1/config/nodes func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) { @@ -425,8 +425,8 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt return nil, nil, err } - status := new(NodeMetadataStatus) - resp, err := s.client.Do(ctx, req, status) + var status *NodeMetadataStatus + resp, err := s.client.Do(ctx, req, &status) if err != nil { return nil, resp, err } @@ -436,7 +436,7 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt // Settings gets the current configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-ghes-settings // //meta:operation GET /manage/v1/config/settings func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) { @@ -446,8 +446,8 @@ func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Res return nil, nil, err } - configSettings := new(ConfigSettings) - resp, err := s.client.Do(ctx, req, configSettings) + var configSettings *ConfigSettings + resp, err := s.client.Do(ctx, req, &configSettings) if err != nil { return nil, resp, err } @@ -457,7 +457,7 @@ func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Res // UpdateSettings updates the configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#set-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-settings // //meta:operation PUT /manage/v1/config/settings func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) { @@ -476,7 +476,7 @@ func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSett // ConfigApply triggers a configuration apply run on the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run // //meta:operation POST /manage/v1/config/apply func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) { @@ -486,8 +486,8 @@ func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOp return nil, nil, err } - configApplyOptions := new(ConfigApplyOptions) - resp, err := s.client.Do(ctx, req, configApplyOptions) + var configApplyOptions *ConfigApplyOptions + resp, err := s.client.Do(ctx, req, &configApplyOptions) if err != nil { return nil, resp, err } @@ -497,7 +497,7 @@ func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOp // ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance. // You can request lat one or specific id one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run // //meta:operation GET /manage/v1/config/apply func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) { @@ -507,8 +507,8 @@ func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigA return nil, nil, err } - status := new(ConfigApplyStatus) - resp, err := s.client.Do(ctx, req, status) + var status *ConfigApplyStatus + resp, err := s.client.Do(ctx, req, &status) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_maintenance.go b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_maintenance.go similarity index 96% rename from vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_maintenance.go rename to vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_maintenance.go index 1788ac790..9a4653303 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_maintenance.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_maintenance.go @@ -46,7 +46,7 @@ type MaintenanceOptions struct { // GetMaintenanceStatus gets the status of maintenance mode for all nodes. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode // //meta:operation GET /manage/v1/maintenance func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) { @@ -71,7 +71,7 @@ func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *Node // CreateMaintenance sets the maintenance mode for the instance. // With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode // //meta:operation POST /manage/v1/maintenance func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_ssh.go b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_ssh.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_ssh.go rename to vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_ssh.go index 0f34d257c..78dc2b35f 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_manage_ghes_ssh.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_manage_ghes_ssh.go @@ -31,7 +31,7 @@ type ClusterSSHKey struct { // DeleteSSHKey deletes the SSH key from the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#delete-a-ssh-key // //meta:operation DELETE /manage/v1/access/ssh func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { @@ -55,7 +55,7 @@ func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SS // GetSSHKey gets the SSH keys configured for the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys // //meta:operation GET /manage/v1/access/ssh func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) { @@ -76,7 +76,7 @@ func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *R // CreateSSHKey adds a new SSH key to the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key // //meta:operation POST /manage/v1/access/ssh func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_network_configurations.go b/vendor/github.com/google/go-github/v85/github/enterprise_network_configurations.go similarity index 79% rename from vendor/github.com/google/go-github/v82/github/enterprise_network_configurations.go rename to vendor/github.com/google/go-github/v85/github/enterprise_network_configurations.go index a6a690d78..034437691 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_network_configurations.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_network_configurations.go @@ -12,7 +12,7 @@ import ( // ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#list-hosted-compute-network-configurations-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-configurations func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { @@ -27,17 +27,18 @@ func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Cont return nil, nil, err } - networks := &NetworkConfigurations{} - resp, err := s.client.Do(ctx, req, networks) + var networks *NetworkConfigurations + resp, err := s.client.Do(ctx, req, &networks) if err != nil { return nil, resp, err } + return networks, resp, nil } // CreateEnterpriseNetworkConfiguration creates a hosted compute network configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#create-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/network-configurations func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -51,8 +52,8 @@ func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Con return nil, nil, err } - network := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, network) + var network *NetworkConfiguration + resp, err := s.client.Do(ctx, req, &network) if err != nil { return nil, resp, err } @@ -62,7 +63,7 @@ func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Con // GetEnterpriseNetworkConfiguration gets a hosted compute network configuration configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id} func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*NetworkConfiguration, *Response, error) { @@ -72,17 +73,18 @@ func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Contex return nil, nil, err } - network := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, network) + var network *NetworkConfiguration + resp, err := s.client.Do(ctx, req, &network) if err != nil { return nil, resp, err } + return network, resp, nil } // UpdateEnterpriseNetworkConfiguration updates a hosted compute network configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#update-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id} func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -96,17 +98,18 @@ func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Con return nil, nil, err } - network := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, network) + var network *NetworkConfiguration + resp, err := s.client.Do(ctx, req, &network) if err != nil { return nil, resp, err } + return network, resp, nil } // DeleteEnterpriseNetworkConfiguration deletes a hosted compute network configuration from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#delete-a-hosted-compute-network-configuration-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id} func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*Response, error) { @@ -115,12 +118,13 @@ func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Con if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } // GetEnterpriseNetworkSettingsResource gets a hosted compute network settings resource configured for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-settings-resource-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id} func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*NetworkSettingsResource, *Response, error) { @@ -130,10 +134,11 @@ func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Con return nil, nil, err } - resource := &NetworkSettingsResource{} - resp, err := s.client.Do(ctx, req, resource) + var resource *NetworkSettingsResource + resp, err := s.client.Do(ctx, req, &resource) if err != nil { return nil, resp, err } + return resource, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_organization_properties.go b/vendor/github.com/google/go-github/v85/github/enterprise_organization_properties.go similarity index 87% rename from vendor/github.com/google/go-github/v82/github/enterprise_organization_properties.go rename to vendor/github.com/google/go-github/v85/github/enterprise_organization_properties.go index 01a646b38..c4ab96c84 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_organization_properties.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_organization_properties.go @@ -37,7 +37,7 @@ type EnterpriseCustomPropertyValuesRequest struct { // GetOrganizationCustomPropertySchema gets all organization custom property definitions that are defined on an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#get-organization-custom-properties-schema-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#get-organization-custom-properties-schema-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/org-properties/schema func (s *EnterpriseService) GetOrganizationCustomPropertySchema(ctx context.Context, enterprise string) (*EnterpriseCustomPropertySchema, *Response, error) { @@ -59,7 +59,7 @@ func (s *EnterpriseService) GetOrganizationCustomPropertySchema(ctx context.Cont // CreateOrUpdateOrganizationCustomPropertySchema creates new or updates existing organization custom properties defined on an enterprise in a batch. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#create-or-update-organization-custom-property-definitions-on-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-organization-custom-property-definitions-on-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/org-properties/schema func (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertySchema(ctx context.Context, enterprise string, schema EnterpriseCustomPropertySchema) (*Response, error) { @@ -79,7 +79,7 @@ func (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertySchema(ctx c // GetOrganizationCustomProperty retrieves a specific organization custom property definition from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#get-an-organization-custom-property-definition-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#get-an-organization-custom-property-definition-from-an-enterprise // //meta:operation GET /enterprises/{enterprise}/org-properties/schema/{custom_property_name} func (s *EnterpriseService) GetOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) { @@ -101,7 +101,7 @@ func (s *EnterpriseService) GetOrganizationCustomProperty(ctx context.Context, e // CreateOrUpdateOrganizationCustomProperty creates a new or updates an existing organization custom property definition that is defined on an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#create-or-update-an-organization-custom-property-definition-on-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-an-organization-custom-property-definition-on-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/org-properties/schema/{custom_property_name} func (s *EnterpriseService) CreateOrUpdateOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string, property CustomProperty) (*Response, error) { @@ -121,7 +121,7 @@ func (s *EnterpriseService) CreateOrUpdateOrganizationCustomProperty(ctx context // DeleteOrganizationCustomProperty removes an organization custom property definition that is defined on an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#remove-an-organization-custom-property-definition-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#remove-an-organization-custom-property-definition-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/org-properties/schema/{custom_property_name} func (s *EnterpriseService) DeleteOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) { @@ -142,7 +142,7 @@ func (s *EnterpriseService) DeleteOrganizationCustomProperty(ctx context.Context // ListOrganizationCustomPropertyValues lists enterprise organizations with all of their custom property values. // Returns a list of organizations and their custom property values defined in the enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#list-custom-property-values-for-organizations-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#list-custom-property-values-for-organizations-in-an-enterprise // //meta:operation GET /enterprises/{enterprise}/org-properties/values func (s *EnterpriseService) ListOrganizationCustomPropertyValues(ctx context.Context, enterprise string, opts *ListOptions) ([]*EnterpriseCustomPropertiesValues, *Response, error) { @@ -170,7 +170,7 @@ func (s *EnterpriseService) ListOrganizationCustomPropertyValues(ctx context.Con // CreateOrUpdateOrganizationCustomPropertyValues creates or updates custom property values for organizations in an enterprise. // To remove a custom property value from an organization, set the property value to null. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#create-or-update-custom-property-values-for-organizations-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-custom-property-values-for-organizations-in-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/org-properties/values func (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertyValues(ctx context.Context, enterprise string, values EnterpriseCustomPropertyValuesRequest) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_properties.go b/vendor/github.com/google/go-github/v85/github/enterprise_properties.go similarity index 87% rename from vendor/github.com/google/go-github/v82/github/enterprise_properties.go rename to vendor/github.com/google/go-github/v85/github/enterprise_properties.go index bc5ab55a3..9eb8b0cec 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_properties.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_properties.go @@ -12,7 +12,7 @@ import ( // GetAllCustomProperties gets all custom properties that are defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#get-custom-properties-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/properties/schema func (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterprise string) ([]*CustomProperty, *Response, error) { @@ -34,7 +34,7 @@ func (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterpri // CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#create-or-update-custom-properties-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/properties/schema func (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, enterprise string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { @@ -62,7 +62,7 @@ func (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, // GetCustomProperty gets a custom property that is defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-a-custom-property-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#get-a-custom-property-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/properties/schema/{custom_property_name} func (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) { @@ -84,7 +84,7 @@ func (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, c // CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#create-or-update-a-custom-property-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/properties/schema/{custom_property_name} func (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, enterprise, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { @@ -106,7 +106,7 @@ func (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, en // RemoveCustomProperty removes a custom property that is defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#remove-a-custom-property-for-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name} func (s *EnterpriseService) RemoveCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_rules.go b/vendor/github.com/google/go-github/v85/github/enterprise_rules.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/enterprise_rules.go rename to vendor/github.com/google/go-github/v85/github/enterprise_rules.go index 3cd3ee4e8..e143f2c65 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_rules.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_rules.go @@ -12,7 +12,7 @@ import ( // CreateRepositoryRuleset creates a repository ruleset for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#create-an-enterprise-repository-ruleset // //meta:operation POST /enterprises/{enterprise}/rulesets func (s *EnterpriseService) CreateRepositoryRuleset(ctx context.Context, enterprise string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { @@ -34,7 +34,7 @@ func (s *EnterpriseService) CreateRepositoryRuleset(ctx context.Context, enterpr // GetRepositoryRuleset gets a repository ruleset for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#get-an-enterprise-repository-ruleset // //meta:operation GET /enterprises/{enterprise}/rulesets/{ruleset_id} func (s *EnterpriseService) GetRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*RepositoryRuleset, *Response, error) { @@ -56,7 +56,7 @@ func (s *EnterpriseService) GetRepositoryRuleset(ctx context.Context, enterprise // UpdateRepositoryRuleset updates a repository ruleset for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#update-an-enterprise-repository-ruleset // //meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} func (s *EnterpriseService) UpdateRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { @@ -78,7 +78,7 @@ func (s *EnterpriseService) UpdateRepositoryRuleset(ctx context.Context, enterpr // DeleteRepositoryRuleset deletes a repository ruleset from the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#delete-an-enterprise-repository-ruleset // //meta:operation DELETE /enterprises/{enterprise}/rulesets/{ruleset_id} func (s *EnterpriseService) DeleteRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_scim.go b/vendor/github.com/google/go-github/v85/github/enterprise_scim.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/enterprise_scim.go rename to vendor/github.com/google/go-github/v85/github/enterprise_scim.go index ea45b2e5c..5d4f025ee 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_scim.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_scim.go @@ -28,7 +28,7 @@ const SCIMSchemasURINamespacesPatchOp = "urn:ietf:params:scim:api:messages:2.0:P // SCIMEnterpriseGroupAttributes represents supported SCIM Enterprise group attributes, and represents the result of calling UpdateSCIMGroupAttribute. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-group-attributes +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#supported-scim-group-attributes type SCIMEnterpriseGroupAttributes struct { DisplayName *string `json:"displayName,omitempty"` // Human-readable name for a group. Members []*SCIMEnterpriseDisplayReference `json:"members,omitempty"` // List of members who are assigned to the group in SCIM provider @@ -65,7 +65,7 @@ type SCIMEnterpriseGroups struct { // ListProvisionedSCIMGroupsEnterpriseOptions represents query parameters for ListProvisionedSCIMGroups. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise--parameters +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-provisioned-scim-groups-for-an-enterprise--parameters type ListProvisionedSCIMGroupsEnterpriseOptions struct { // If specified, only results that match the specified filter will be returned. // Possible filters are `externalId`, `id`, and `displayName`. For example, `externalId eq "a123"`. @@ -82,7 +82,7 @@ type ListProvisionedSCIMGroupsEnterpriseOptions struct { // GetProvisionedSCIMGroupEnterpriseOptions represents query parameters for GetProvisionedSCIMGroup. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-an-enterprise-group type GetProvisionedSCIMGroupEnterpriseOptions struct { // Excludes the specified attributes from being returned in the results. ExcludedAttributes *string `url:"excludedAttributes,omitempty"` @@ -90,7 +90,7 @@ type GetProvisionedSCIMGroupEnterpriseOptions struct { // SCIMEnterpriseUserAttributes represents supported SCIM enterprise user attributes, and represents the result of calling UpdateSCIMUserAttribute. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#supported-scim-user-attributes type SCIMEnterpriseUserAttributes struct { DisplayName string `json:"displayName"` // Human-readable name for a user Name *SCIMEnterpriseUserName `json:"name,omitempty"` // The user's full name @@ -140,7 +140,7 @@ type SCIMEnterpriseUsers struct { // ListProvisionedSCIMUsersEnterpriseOptions represents query parameters for ListProvisionedSCIMUsers. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-scim-provisioned-identities-for-an-enterprise type ListProvisionedSCIMUsersEnterpriseOptions struct { // If specified, only results that match the specified filter will be returned. // Possible filters are `userName`, `externalId`, `id`, and `displayName`. For example, `externalId eq "a123"`. @@ -155,7 +155,7 @@ type ListProvisionedSCIMUsersEnterpriseOptions struct { // SCIMEnterpriseAttribute represents attribute operations for UpdateSCIMGroupAttribute or UpdateSCIMUserAttribute. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-enterprise-group type SCIMEnterpriseAttribute struct { Schemas []string `json:"schemas"` // The URIs that are used to indicate the namespaces for a SCIM patch operation. Operations []*SCIMEnterpriseAttributeOperation `json:"Operations"` // Set of operations to be performed. @@ -165,7 +165,7 @@ type SCIMEnterpriseAttribute struct { type SCIMEnterpriseAttributeOperation struct { Op string `json:"op"` // Can be one of: `add`, `replace`, `remove`. Path *string `json:"path,omitempty"` // Path to the attribute being modified (Filters are not supported). - Value *string `json:"value,omitempty"` // New value for the attribute being modified. + Value any `json:"value,omitempty"` // New value for the attribute being modified. } // ListProvisionedSCIMGroups lists provisioned SCIM groups in an enterprise. @@ -174,7 +174,7 @@ type SCIMEnterpriseAttributeOperation struct { // exclude the specified attributes, e.g. `members` to exclude members from the // response. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-provisioned-scim-groups-for-an-enterprise // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enterprise string, opts *ListProvisionedSCIMGroupsEnterpriseOptions) (*SCIMEnterpriseGroups, *Response, error) { @@ -190,8 +190,8 @@ func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enter } req.Header.Set("Accept", mediaTypeSCIM) - groups := new(SCIMEnterpriseGroups) - resp, err := s.client.Do(ctx, req, groups) + var groups *SCIMEnterpriseGroups + resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err } @@ -205,7 +205,7 @@ func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enter // as external group members. Providers are responsible for maintaining a // mapping between the `externalId` and `id` for each user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-scim-provisioned-identities-for-an-enterprise // //meta:operation GET /scim/v2/enterprises/{enterprise}/Users func (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterprise string, opts *ListProvisionedSCIMUsersEnterpriseOptions) (*SCIMEnterpriseUsers, *Response, error) { @@ -221,8 +221,8 @@ func (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterp } req.Header.Set("Accept", mediaTypeSCIM) - users := new(SCIMEnterpriseUsers) - resp, err := s.client.Do(ctx, req, users) + var users *SCIMEnterpriseUsers + resp, err := s.client.Do(ctx, req, &users) if err != nil { return nil, resp, err } @@ -236,7 +236,7 @@ func (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterp // existing group information that you don't provide will be removed, including group membership. To update only // specific attributes, refer to the `Enterprise.UpdateSCIMGroupAttribute()` method. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#set-scim-information-for-a-provisioned-enterprise-group // //meta:operation PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) SetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID string, group SCIMEnterpriseGroupAttributes) (*SCIMEnterpriseGroupAttributes, *Response, error) { @@ -247,8 +247,8 @@ func (s *EnterpriseService) SetProvisionedSCIMGroup(ctx context.Context, enterpr } req.Header.Set("Accept", mediaTypeSCIM) - groupNew := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, groupNew) + var groupNew *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(ctx, req, &groupNew) if err != nil { return nil, resp, err } @@ -264,7 +264,7 @@ func (s *EnterpriseService) SetProvisionedSCIMGroup(ctx context.Context, enterpr // // **Warning**: Setting `active: false` will suspend a user, and their handle and email will be obfuscated. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#set-scim-information-for-a-provisioned-enterprise-user // //meta:operation PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) SetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string, user SCIMEnterpriseUserAttributes) (*SCIMEnterpriseUserAttributes, *Response, error) { @@ -275,8 +275,8 @@ func (s *EnterpriseService) SetProvisionedSCIMUser(ctx context.Context, enterpri } req.Header.Set("Accept", mediaTypeSCIM) - userNew := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, userNew) + var userNew *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(ctx, req, &userNew) if err != nil { return nil, resp, err } @@ -294,7 +294,7 @@ func (s *EnterpriseService) SetProvisionedSCIMUser(ctx context.Context, enterpri // You can submit group memberships individually or in batches for improved // efficiency. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-enterprise-group // //meta:operation PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) UpdateSCIMGroupAttribute(ctx context.Context, enterprise, scimGroupID string, attribute SCIMEnterpriseAttribute) (*SCIMEnterpriseGroupAttributes, *Response, error) { @@ -305,8 +305,8 @@ func (s *EnterpriseService) UpdateSCIMGroupAttribute(ctx context.Context, enterp } req.Header.Set("Accept", mediaTypeSCIM) - group := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, group) + var group *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(ctx, req, &group) if err != nil { return nil, resp, err } @@ -326,7 +326,7 @@ func (s *EnterpriseService) UpdateSCIMGroupAttribute(ctx context.Context, enterp // Warning: Setting `active: false` will suspend a user, and their handle and // email will be obfuscated. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-enterprise-user // //meta:operation PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) UpdateSCIMUserAttribute(ctx context.Context, enterprise, scimUserID string, attribute SCIMEnterpriseAttribute) (*SCIMEnterpriseUserAttributes, *Response, error) { @@ -337,8 +337,8 @@ func (s *EnterpriseService) UpdateSCIMUserAttribute(ctx context.Context, enterpr } req.Header.Set("Accept", mediaTypeSCIM) - user := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, user) + var user *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(ctx, req, &user) if err != nil { return nil, resp, err } @@ -348,7 +348,7 @@ func (s *EnterpriseService) UpdateSCIMUserAttribute(ctx context.Context, enterpr // ProvisionSCIMGroup creates a SCIM group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#provision-a-scim-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#provision-a-scim-enterprise-group // //meta:operation POST /scim/v2/enterprises/{enterprise}/Groups func (s *EnterpriseService) ProvisionSCIMGroup(ctx context.Context, enterprise string, group SCIMEnterpriseGroupAttributes) (*SCIMEnterpriseGroupAttributes, *Response, error) { @@ -359,8 +359,8 @@ func (s *EnterpriseService) ProvisionSCIMGroup(ctx context.Context, enterprise s } req.Header.Set("Accept", mediaTypeSCIM) - groupProvisioned := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, groupProvisioned) + var groupProvisioned *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(ctx, req, &groupProvisioned) if err != nil { return nil, resp, err } @@ -370,7 +370,7 @@ func (s *EnterpriseService) ProvisionSCIMGroup(ctx context.Context, enterprise s // ProvisionSCIMUser creates an external identity for a new SCIM enterprise user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#provision-a-scim-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#provision-a-scim-enterprise-user // //meta:operation POST /scim/v2/enterprises/{enterprise}/Users func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise string, user SCIMEnterpriseUserAttributes) (*SCIMEnterpriseUserAttributes, *Response, error) { @@ -381,8 +381,8 @@ func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise st } req.Header.Set("Accept", mediaTypeSCIM) - userProvisioned := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, userProvisioned) + var userProvisioned *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(ctx, req, &userProvisioned) if err != nil { return nil, resp, err } @@ -396,7 +396,7 @@ func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise st // attributes from being returned in the results. Using this parameter can // speed up response time. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-an-enterprise-group // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID string, opts *GetProvisionedSCIMGroupEnterpriseOptions) (*SCIMEnterpriseGroupAttributes, *Response, error) { @@ -412,8 +412,8 @@ func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterpr } req.Header.Set("Accept", mediaTypeSCIM) - group := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, group) + var group *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(ctx, req, &group) if err != nil { return nil, resp, err } @@ -423,7 +423,7 @@ func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterpr // GetProvisionedSCIMUser gets information about a SCIM user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-an-enterprise-user // //meta:operation GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string) (*SCIMEnterpriseUserAttributes, *Response, error) { @@ -435,8 +435,8 @@ func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterpri } req.Header.Set("Accept", mediaTypeSCIM) - user := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, user) + var user *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(ctx, req, &user) if err != nil { return nil, resp, err } @@ -446,7 +446,7 @@ func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterpri // DeleteSCIMGroup deletes a SCIM group from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#delete-a-scim-group-from-an-enterprise // //meta:operation DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) DeleteSCIMGroup(ctx context.Context, enterprise, scimGroupID string) (*Response, error) { @@ -467,7 +467,7 @@ func (s *EnterpriseService) DeleteSCIMGroup(ctx context.Context, enterprise, sci // avatar, PATs, SSH keys, OAuth authorizations, GPG keys, and SAML mappings. // This action is irreversible. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#delete-a-scim-user-from-an-enterprise // //meta:operation DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) DeleteSCIMUser(ctx context.Context, enterprise, scimUserID string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/enterprise_team.go b/vendor/github.com/google/go-github/v85/github/enterprise_team.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/enterprise_team.go rename to vendor/github.com/google/go-github/v85/github/enterprise_team.go index e9317b077..30d2913e8 100644 --- a/vendor/github.com/google/go-github/v82/github/enterprise_team.go +++ b/vendor/github.com/google/go-github/v85/github/enterprise_team.go @@ -40,7 +40,7 @@ type EnterpriseTeamCreateOrUpdateRequest struct { // ListTeams lists all teams in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#list-enterprise-teams +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#list-enterprise-teams // //meta:operation GET /enterprises/{enterprise}/teams func (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, opts *ListOptions) ([]*EnterpriseTeam, *Response, error) { @@ -66,7 +66,7 @@ func (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, op // CreateTeam creates a new team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#create-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#create-an-enterprise-team // //meta:operation POST /enterprises/{enterprise}/teams func (s *EnterpriseService) CreateTeam(ctx context.Context, enterprise string, team EnterpriseTeamCreateOrUpdateRequest) (*EnterpriseTeam, *Response, error) { @@ -88,7 +88,7 @@ func (s *EnterpriseService) CreateTeam(ctx context.Context, enterprise string, t // GetTeam retrieves a team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#get-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#get-an-enterprise-team // //meta:operation GET /enterprises/{enterprise}/teams/{team_slug} func (s *EnterpriseService) GetTeam(ctx context.Context, enterprise, teamSlug string) (*EnterpriseTeam, *Response, error) { @@ -110,7 +110,7 @@ func (s *EnterpriseService) GetTeam(ctx context.Context, enterprise, teamSlug st // UpdateTeam updates a team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#update-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#update-an-enterprise-team // //meta:operation PATCH /enterprises/{enterprise}/teams/{team_slug} func (s *EnterpriseService) UpdateTeam(ctx context.Context, enterprise, teamSlug string, team EnterpriseTeamCreateOrUpdateRequest) (*EnterpriseTeam, *Response, error) { @@ -132,7 +132,7 @@ func (s *EnterpriseService) UpdateTeam(ctx context.Context, enterprise, teamSlug // DeleteTeam deletes a team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#delete-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#delete-an-enterprise-team // //meta:operation DELETE /enterprises/{enterprise}/teams/{team_slug} func (s *EnterpriseService) DeleteTeam(ctx context.Context, enterprise, teamSlug string) (*Response, error) { @@ -153,7 +153,7 @@ func (s *EnterpriseService) DeleteTeam(ctx context.Context, enterprise, teamSlug // ListTeamMembers lists all members of an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#list-members-in-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#list-members-in-an-enterprise-team // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships func (s *EnterpriseService) ListTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, opts *ListOptions) ([]*User, *Response, error) { @@ -179,7 +179,7 @@ func (s *EnterpriseService) ListTeamMembers(ctx context.Context, enterprise, ent // BulkAddTeamMembers adds multiple members to an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-add-team-members +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#bulk-add-team-members // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add func (s *EnterpriseService) BulkAddTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) { @@ -200,7 +200,7 @@ func (s *EnterpriseService) BulkAddTeamMembers(ctx context.Context, enterprise, // BulkRemoveTeamMembers removes multiple members from an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-remove-team-members +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#bulk-remove-team-members // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove func (s *EnterpriseService) BulkRemoveTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) { @@ -221,7 +221,7 @@ func (s *EnterpriseService) BulkRemoveTeamMembers(ctx context.Context, enterpris // GetTeamMembership retrieves a team membership for a user in an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#get-enterprise-team-membership +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#get-enterprise-team-membership // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username} func (s *EnterpriseService) GetTeamMembership(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) { @@ -243,7 +243,7 @@ func (s *EnterpriseService) GetTeamMembership(ctx context.Context, enterprise, e // AddTeamMember adds a member to an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#add-team-member +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#add-team-member // //meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username} func (s *EnterpriseService) AddTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) { @@ -265,7 +265,7 @@ func (s *EnterpriseService) AddTeamMember(ctx context.Context, enterprise, enter // RemoveTeamMember removes a member from an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#remove-team-membership +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#remove-team-membership // //meta:operation DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username} func (s *EnterpriseService) RemoveTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*Response, error) { @@ -286,7 +286,7 @@ func (s *EnterpriseService) RemoveTeamMember(ctx context.Context, enterprise, en // ListAssignments gets all organizations assigned to an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignments +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#get-organization-assignments // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations func (s *EnterpriseService) ListAssignments(ctx context.Context, enterprise, enterpriseTeam string, opts *ListOptions) ([]*Organization, *Response, error) { @@ -312,7 +312,7 @@ func (s *EnterpriseService) ListAssignments(ctx context.Context, enterprise, ent // AddMultipleAssignments assigns an enterprise team to multiple organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#add-organization-assignments // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add func (s *EnterpriseService) AddMultipleAssignments(ctx context.Context, enterprise, enterpriseTeam string, organizationSlugs []string) ([]*Organization, *Response, error) { @@ -334,7 +334,7 @@ func (s *EnterpriseService) AddMultipleAssignments(ctx context.Context, enterpri // RemoveMultipleAssignments unassigns an enterprise team from multiple organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#remove-organization-assignments +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#remove-organization-assignments // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove func (s *EnterpriseService) RemoveMultipleAssignments(ctx context.Context, enterprise, enterpriseTeam string, organizationSlugs []string) ([]*Organization, *Response, error) { @@ -356,7 +356,7 @@ func (s *EnterpriseService) RemoveMultipleAssignments(ctx context.Context, enter // GetAssignment checks if an enterprise team is assigned to an organization. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignment +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#get-organization-assignment // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org} func (s *EnterpriseService) GetAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Organization, *Response, error) { @@ -378,7 +378,7 @@ func (s *EnterpriseService) GetAssignment(ctx context.Context, enterprise, enter // AddAssignment assigns an enterprise team to an organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-an-organization-assignment +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#add-an-organization-assignment // //meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org} func (s *EnterpriseService) AddAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Organization, *Response, error) { @@ -400,7 +400,7 @@ func (s *EnterpriseService) AddAssignment(ctx context.Context, enterprise, enter // RemoveAssignment unassigns an enterprise team from an organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#delete-an-organization-assignment +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#delete-an-organization-assignment // //meta:operation DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org} func (s *EnterpriseService) RemoveAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/event.go b/vendor/github.com/google/go-github/v85/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v82/github/event.go rename to vendor/github.com/google/go-github/v85/github/event.go diff --git a/vendor/github.com/google/go-github/v82/github/event_types.go b/vendor/github.com/google/go-github/v85/github/event_types.go similarity index 99% rename from vendor/github.com/google/go-github/v82/github/event_types.go rename to vendor/github.com/google/go-github/v85/github/event_types.go index 2a085d47b..de4223cdd 100644 --- a/vendor/github.com/google/go-github/v82/github/event_types.go +++ b/vendor/github.com/google/go-github/v85/github/event_types.go @@ -359,7 +359,7 @@ type CommentDiscussion struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Discussions REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/discussions/comments#get-a-discussion-comment + // See: https://docs.github.com/rest/discussions/comments?apiVersion=2022-11-28#get-a-discussion-comment AuthorAssociation *string `json:"author_association,omitempty"` Body *string `json:"body,omitempty"` ChildCommentCount *int `json:"child_comment_count,omitempty"` @@ -414,7 +414,7 @@ type Discussion struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Discussions REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/discussions/discussions#get-a-discussion + // See: https://docs.github.com/rest/discussions/discussions?apiVersion=2022-11-28#get-a-discussion AuthorAssociation *string `json:"author_association,omitempty"` ActiveLockReason *string `json:"active_lock_reason,omitempty"` Body *string `json:"body,omitempty"` @@ -1332,21 +1332,21 @@ type PushEvent struct { // // Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025. // Use the Commits REST API endpoint to get commit information. - // See: https://docs.github.com/rest/commits/commits#list-commits + // See: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-commits Size *int `json:"size,omitempty"` // Commits is the list of commits in the push event. // // This field is only populated for webhook events. // It has been removed from Events API payloads on October 7, 2025. // Use the Commits REST API endpoint to get detailed commit information. - // See: https://docs.github.com/rest/commits/commits#list-commits + // See: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-commits Commits []*HeadCommit `json:"commits,omitempty"` Before *string `json:"before,omitempty"` // DistinctSize is the number of distinct commits in the push. // // Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025. // Use the Compare REST API endpoint to get detailed comparison information. - // See: https://docs.github.com/rest/commits/commits#compare-two-commits + // See: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits DistinctSize *int `json:"distinct_size,omitempty"` // The following fields are only populated by Webhook events. @@ -1934,8 +1934,8 @@ type AdvisoryVulnerability struct { FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` // PatchedVersions and VulnerableFunctions are used in the following APIs: - // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization - // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories + // - https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization + // - https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories PatchedVersions *string `json:"patched_versions,omitempty"` VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` } @@ -1984,7 +1984,7 @@ type CodeScanningAlertEvent struct { // SponsorshipEvent represents a sponsorship event in GitHub. // -// GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent +// GitHub API docs: https://docs.github.com/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent type SponsorshipEvent struct { Action *string `json:"action,omitempty"` EffectiveDate *string `json:"effective_date,omitempty"` diff --git a/vendor/github.com/google/go-github/v82/github/gists.go b/vendor/github.com/google/go-github/v85/github/gists.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/gists.go rename to vendor/github.com/google/go-github/v85/github/gists.go index 8b5dd47d8..0a75ae647 100644 --- a/vendor/github.com/google/go-github/v82/github/gists.go +++ b/vendor/github.com/google/go-github/v85/github/gists.go @@ -14,7 +14,7 @@ import ( // GistsService handles communication with the Gist related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/gists +// GitHub API docs: https://docs.github.com/rest/gists?apiVersion=2022-11-28 type GistsService service // Gist represents a GitHub's gist. @@ -96,9 +96,9 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-a-user // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-the-authenticated-user // //meta:operation GET /gists //meta:operation GET /users/{username}/gists @@ -130,7 +130,7 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-public-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-public-gists // //meta:operation GET /gists/public func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { @@ -155,7 +155,7 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-starred-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-starred-gists // //meta:operation GET /gists/starred func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { @@ -180,7 +180,7 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#get-a-gist // //meta:operation GET /gists/{gist_id} func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { @@ -190,8 +190,8 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er return nil, nil, err } - gist := new(Gist) - resp, err := s.client.Do(ctx, req, gist) + var gist *Gist + resp, err := s.client.Do(ctx, req, &gist) if err != nil { return nil, resp, err } @@ -201,7 +201,7 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er // GetRevision gets a specific revision of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist-revision +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#get-a-gist-revision // //meta:operation GET /gists/{gist_id}/{sha} func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) { @@ -211,8 +211,8 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, return nil, nil, err } - gist := new(Gist) - resp, err := s.client.Do(ctx, req, gist) + var gist *Gist + resp, err := s.client.Do(ctx, req, &gist) if err != nil { return nil, resp, err } @@ -222,7 +222,7 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, // Create a gist for authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#create-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#create-a-gist // //meta:operation POST /gists func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) { @@ -232,8 +232,8 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response return nil, nil, err } - g := new(Gist) - resp, err := s.client.Do(ctx, req, g) + var g *Gist + resp, err := s.client.Do(ctx, req, &g) if err != nil { return nil, resp, err } @@ -243,7 +243,7 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#update-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#update-a-gist // //meta:operation PATCH /gists/{gist_id} func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { @@ -253,8 +253,8 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, return nil, nil, err } - g := new(Gist) - resp, err := s.client.Do(ctx, req, g) + var g *Gist + resp, err := s.client.Do(ctx, req, &g) if err != nil { return nil, resp, err } @@ -264,7 +264,7 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, // ListCommits lists commits of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-commits +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gist-commits // //meta:operation GET /gists/{gist_id}/commits func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) { @@ -290,7 +290,7 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt // Delete a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#delete-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#delete-a-gist // //meta:operation DELETE /gists/{gist_id} func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) { @@ -305,7 +305,7 @@ func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) // Star a gist on behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#star-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#star-a-gist // //meta:operation PUT /gists/{gist_id}/star func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { @@ -320,7 +320,7 @@ func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { // Unstar a gist on a behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#unstar-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#unstar-a-gist // //meta:operation DELETE /gists/{gist_id}/star func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) { @@ -335,7 +335,7 @@ func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) // IsStarred checks if a gist is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#check-if-a-gist-is-starred // //meta:operation GET /gists/{gist_id}/star func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) { @@ -352,7 +352,7 @@ func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Respons // Fork a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#fork-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#fork-a-gist // //meta:operation POST /gists/{gist_id}/forks func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) { @@ -362,8 +362,8 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e return nil, nil, err } - g := new(Gist) - resp, err := s.client.Do(ctx, req, g) + var g *Gist + resp, err := s.client.Do(ctx, req, &g) if err != nil { return nil, resp, err } @@ -373,7 +373,7 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e // ListForks lists forks of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-forks +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gist-forks // //meta:operation GET /gists/{gist_id}/forks func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/gists_comments.go b/vendor/github.com/google/go-github/v85/github/gists_comments.go similarity index 80% rename from vendor/github.com/google/go-github/v82/github/gists_comments.go rename to vendor/github.com/google/go-github/v85/github/gists_comments.go index 5e0614231..7b7fff0af 100644 --- a/vendor/github.com/google/go-github/v82/github/gists_comments.go +++ b/vendor/github.com/google/go-github/v85/github/gists_comments.go @@ -25,7 +25,7 @@ func (g GistComment) String() string { // ListComments lists all comments for a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#list-gist-comments +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#list-gist-comments // //meta:operation GET /gists/{gist_id}/comments func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) { @@ -51,7 +51,7 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li // GetComment retrieves a single comment from a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#get-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#get-a-gist-comment // //meta:operation GET /gists/{gist_id}/comments/{comment_id} func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) { @@ -61,8 +61,8 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID return nil, nil, err } - c := new(GistComment) - resp, err := s.client.Do(ctx, req, c) + var c *GistComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -72,7 +72,7 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID // CreateComment creates a comment for a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#create-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#create-a-gist-comment // //meta:operation POST /gists/{gist_id}/comments func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) { @@ -82,8 +82,8 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment return nil, nil, err } - c := new(GistComment) - resp, err := s.client.Do(ctx, req, c) + var c *GistComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -93,7 +93,7 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment // EditComment edits an existing gist comment. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#update-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#update-a-gist-comment // //meta:operation PATCH /gists/{gist_id}/comments/{comment_id} func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) { @@ -103,8 +103,8 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID return nil, nil, err } - c := new(GistComment) - resp, err := s.client.Do(ctx, req, c) + var c *GistComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -114,7 +114,7 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID // DeleteComment deletes a gist comment. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#delete-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#delete-a-gist-comment // //meta:operation DELETE /gists/{gist_id}/comments/{comment_id} func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/git.go b/vendor/github.com/google/go-github/v85/github/git.go similarity index 80% rename from vendor/github.com/google/go-github/v82/github/git.go rename to vendor/github.com/google/go-github/v85/github/git.go index 2ca835e1b..ce172cd06 100644 --- a/vendor/github.com/google/go-github/v82/github/git.go +++ b/vendor/github.com/google/go-github/v85/github/git.go @@ -8,5 +8,5 @@ package github // GitService handles communication with the git data related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/git/ +// GitHub API docs: https://docs.github.com/rest/git?apiVersion=2022-11-28 type GitService service diff --git a/vendor/github.com/google/go-github/v82/github/git_blobs.go b/vendor/github.com/google/go-github/v85/github/git_blobs.go similarity index 83% rename from vendor/github.com/google/go-github/v82/github/git_blobs.go rename to vendor/github.com/google/go-github/v85/github/git_blobs.go index c734d595b..f6ec83727 100644 --- a/vendor/github.com/google/go-github/v82/github/git_blobs.go +++ b/vendor/github.com/google/go-github/v85/github/git_blobs.go @@ -23,7 +23,7 @@ type Blob struct { // GetBlob fetches a blob from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs?apiVersion=2022-11-28#get-a-blob // //meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blob, *Response, error) { @@ -33,8 +33,8 @@ func (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blo return nil, nil, err } - blob := new(Blob) - resp, err := s.client.Do(ctx, req, blob) + var blob *Blob + resp, err := s.client.Do(ctx, req, &blob) if err != nil { return nil, resp, err } @@ -45,7 +45,7 @@ func (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blo // GetBlobRaw fetches a blob's contents from a repo. // Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs?apiVersion=2022-11-28#get-a-blob // //meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) { @@ -68,7 +68,7 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // CreateBlob creates a blob object. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs?apiVersion=2022-11-28#create-a-blob // //meta:operation POST /repos/{owner}/{repo}/git/blobs func (s *GitService) CreateBlob(ctx context.Context, owner, repo string, blob Blob) (*Blob, *Response, error) { @@ -78,11 +78,11 @@ func (s *GitService) CreateBlob(ctx context.Context, owner, repo string, blob Bl return nil, nil, err } - t := new(Blob) - resp, err := s.client.Do(ctx, req, t) + var v *Blob + resp, err := s.client.Do(ctx, req, &v) if err != nil { return nil, resp, err } - return t, resp, nil + return v, resp, nil } diff --git a/vendor/github.com/google/go-github/v82/github/git_commits.go b/vendor/github.com/google/go-github/v85/github/git_commits.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/git_commits.go rename to vendor/github.com/google/go-github/v85/github/git_commits.go index 5bf6cf7aa..b75cd70cb 100644 --- a/vendor/github.com/google/go-github/v82/github/git_commits.go +++ b/vendor/github.com/google/go-github/v85/github/git_commits.go @@ -82,7 +82,7 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // -// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object +// GitHub API docs: https://docs.github.com/rest/git/commits?apiVersion=2022-11-28#get-a-commit-object // //meta:operation GET /repos/{owner}/{repo}/git/commits/{commit_sha} func (s *GitService) GetCommit(ctx context.Context, owner, repo, sha string) (*Commit, *Response, error) { @@ -92,8 +92,8 @@ func (s *GitService) GetCommit(ctx context.Context, owner, repo, sha string) (*C return nil, nil, err } - c := new(Commit) - resp, err := s.client.Do(ctx, req, c) + var c *Commit + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -126,7 +126,7 @@ type CreateCommitOptions struct { // data if omitted. If the commit.Author is omitted, it will be filled in with // the authenticated user’s information and the current date. // -// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits?apiVersion=2022-11-28#create-a-commit // //meta:operation POST /repos/{owner}/{repo}/git/commits func (s *GitService) CreateCommit(ctx context.Context, owner, repo string, commit Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { @@ -166,8 +166,8 @@ func (s *GitService) CreateCommit(ctx context.Context, owner, repo string, commi return nil, nil, err } - c := new(Commit) - resp, err := s.client.Do(ctx, req, c) + var c *Commit + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/git_refs.go b/vendor/github.com/google/go-github/v85/github/git_refs.go similarity index 87% rename from vendor/github.com/google/go-github/v82/github/git_refs.go rename to vendor/github.com/google/go-github/v85/github/git_refs.go index bca7741d9..c26ad2684 100644 --- a/vendor/github.com/google/go-github/v82/github/git_refs.go +++ b/vendor/github.com/google/go-github/v85/github/git_refs.go @@ -52,7 +52,7 @@ type UpdateRef struct { // GetRef fetches a single reference in a repository. // The ref must be formatted as `heads/` for branches and `tags/` for tags. // -// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#get-a-reference // //meta:operation GET /repos/{owner}/{repo}/git/ref/{ref} func (s *GitService) GetRef(ctx context.Context, owner, repo, ref string) (*Reference, *Response, error) { @@ -63,8 +63,8 @@ func (s *GitService) GetRef(ctx context.Context, owner, repo, ref string) (*Refe return nil, nil, err } - r := new(Reference) - resp, err := s.client.Do(ctx, req, r) + var r *Reference + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -87,7 +87,7 @@ func refURLEscape(ref string) string { // If the ref doesn't exist in the repository, but existing refs start with ref, they will be returned as an array. // Use an empty ref to list all references. // -// GitHub API docs: https://docs.github.com/rest/git/refs#list-matching-references +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#list-matching-references // //meta:operation GET /repos/{owner}/{repo}/git/matching-refs/{ref} func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo, ref string) ([]*Reference, *Response, error) { @@ -110,7 +110,7 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo, ref stri // CreateRef creates a new ref in a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#create-a-reference // //meta:operation POST /repos/{owner}/{repo}/git/refs func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref CreateRef) (*Reference, *Response, error) { @@ -131,8 +131,8 @@ func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref Crea return nil, nil, err } - r := new(Reference) - resp, err := s.client.Do(ctx, req, r) + var r *Reference + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -142,7 +142,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref Crea // UpdateRef updates an existing ref in a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#update-a-reference // //meta:operation PATCH /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, updateRef UpdateRef) (*Reference, *Response, error) { @@ -161,8 +161,8 @@ func (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, upd return nil, nil, err } - r := new(Reference) - resp, err := s.client.Do(ctx, req, r) + var r *Reference + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -172,7 +172,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, upd // DeleteRef deletes a ref from a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#delete-a-reference // //meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) DeleteRef(ctx context.Context, owner, repo, ref string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/git_tags.go b/vendor/github.com/google/go-github/v85/github/git_tags.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/git_tags.go rename to vendor/github.com/google/go-github/v85/github/git_tags.go index 750b03760..5268ee043 100644 --- a/vendor/github.com/google/go-github/v82/github/git_tags.go +++ b/vendor/github.com/google/go-github/v85/github/git_tags.go @@ -33,7 +33,7 @@ type CreateTag struct { // GetTag fetches a tag from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag +// GitHub API docs: https://docs.github.com/rest/git/tags?apiVersion=2022-11-28#get-a-tag // //meta:operation GET /repos/{owner}/{repo}/git/tags/{tag_sha} func (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, *Response, error) { @@ -43,8 +43,8 @@ func (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, return nil, nil, err } - tag := new(Tag) - resp, err := s.client.Do(ctx, req, tag) + var tag *Tag + resp, err := s.client.Do(ctx, req, &tag) if err != nil { return nil, resp, err } @@ -54,7 +54,7 @@ func (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, // CreateTag creates a tag object. // -// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object +// GitHub API docs: https://docs.github.com/rest/git/tags?apiVersion=2022-11-28#create-a-tag-object // //meta:operation POST /repos/{owner}/{repo}/git/tags func (s *GitService) CreateTag(ctx context.Context, owner, repo string, tag CreateTag) (*Tag, *Response, error) { @@ -65,8 +65,8 @@ func (s *GitService) CreateTag(ctx context.Context, owner, repo string, tag Crea return nil, nil, err } - t := new(Tag) - resp, err := s.client.Do(ctx, req, t) + var t *Tag + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/git_trees.go b/vendor/github.com/google/go-github/v85/github/git_trees.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/git_trees.go rename to vendor/github.com/google/go-github/v85/github/git_trees.go index 2ff0dc592..87e1cc5a5 100644 --- a/vendor/github.com/google/go-github/v82/github/git_trees.go +++ b/vendor/github.com/google/go-github/v85/github/git_trees.go @@ -101,7 +101,7 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GetTree fetches the Tree object for a given sha hash from a repository. // -// GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees?apiVersion=2022-11-28#get-a-tree // //meta:operation GET /repos/{owner}/{repo}/git/trees/{tree_sha} func (s *GitService) GetTree(ctx context.Context, owner, repo, sha string, recursive bool) (*Tree, *Response, error) { @@ -115,8 +115,8 @@ func (s *GitService) GetTree(ctx context.Context, owner, repo, sha string, recur return nil, nil, err } - t := new(Tree) - resp, err := s.client.Do(ctx, req, t) + var t *Tree + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -140,7 +140,7 @@ type createTree struct { // include a [TreeEntry] with the path and both SHA and Content set to nil. // Entire directories can be deleted this way. // -// GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees?apiVersion=2022-11-28#create-a-tree // //meta:operation POST /repos/{owner}/{repo}/git/trees func (s *GitService) CreateTree(ctx context.Context, owner, repo, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { @@ -170,8 +170,8 @@ func (s *GitService) CreateTree(ctx context.Context, owner, repo, baseTree strin return nil, nil, err } - t := new(Tree) - resp, err := s.client.Do(ctx, req, t) + var t *Tree + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/github-accessors.go b/vendor/github.com/google/go-github/v85/github/github-accessors.go similarity index 77% rename from vendor/github.com/google/go-github/v82/github/github-accessors.go rename to vendor/github.com/google/go-github/v85/github/github-accessors.go index 03a8bc19e..e8387d6f0 100644 --- a/vendor/github.com/google/go-github/v82/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v85/github/github-accessors.go @@ -1,12 +1,12 @@ +// Code generated by gen-accessors; DO NOT EDIT. +// Instead, please run "go generate ./..." as described here: +// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch + // Copyright 2017 The go-github AUTHORS. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Code generated by gen-accessors; DO NOT EDIT. -// Instead, please run "go generate ./..." as described here: -// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch - package github import ( @@ -14,6 +14,14 @@ import ( "time" ) +// GetMessage returns the Message field. +func (a *AbuseRateLimitError) GetMessage() string { + if a == nil { + return "" + } + return a.Message +} + // GetRetryAfter returns the RetryAfter field if it's non-nil, zero value otherwise. func (a *AbuseRateLimitError) GetRetryAfter() time.Duration { if a == nil || a.RetryAfter == nil { @@ -70,6 +78,14 @@ func (a *AcceptedAssignment) GetRepository() *Repository { return a.Repository } +// GetStudents returns the Students slice if it's non-nil, nil otherwise. +func (a *AcceptedAssignment) GetStudents() []*ClassroomUser { + if a == nil || a.Students == nil { + return nil + } + return a.Students +} + // GetSubmitted returns the Submitted field if it's non-nil, zero value otherwise. func (a *AcceptedAssignment) GetSubmitted() bool { if a == nil || a.Submitted == nil { @@ -78,6 +94,38 @@ func (a *AcceptedAssignment) GetSubmitted() bool { return *a.Submitted } +// GetRaw returns the Raw slice if it's non-nil, nil otherwise. +func (a *AcceptedError) GetRaw() []byte { + if a == nil || a.Raw == nil { + return nil + } + return a.Raw +} + +// GetFullName returns the FullName field. +func (a *AccessibleRepository) GetFullName() string { + if a == nil { + return "" + } + return a.FullName +} + +// GetID returns the ID field. +func (a *AccessibleRepository) GetID() int64 { + if a == nil { + return 0 + } + return a.ID +} + +// GetName returns the Name field. +func (a *AccessibleRepository) GetName() string { + if a == nil { + return "" + } + return a.Name +} + // GetGithubOwnedAllowed returns the GithubOwnedAllowed field if it's non-nil, zero value otherwise. func (a *ActionsAllowed) GetGithubOwnedAllowed() bool { if a == nil || a.GithubOwnedAllowed == nil { @@ -86,6 +134,14 @@ func (a *ActionsAllowed) GetGithubOwnedAllowed() bool { return *a.GithubOwnedAllowed } +// GetPatternsAllowed returns the PatternsAllowed slice if it's non-nil, nil otherwise. +func (a *ActionsAllowed) GetPatternsAllowed() []string { + if a == nil || a.PatternsAllowed == nil { + return nil + } + return a.PatternsAllowed +} + // GetVerifiedAllowed returns the VerifiedAllowed field if it's non-nil, zero value otherwise. func (a *ActionsAllowed) GetVerifiedAllowed() bool { if a == nil || a.VerifiedAllowed == nil { @@ -150,6 +206,22 @@ func (a *ActionsCache) GetVersion() string { return *a.Version } +// GetActionsCaches returns the ActionsCaches slice if it's non-nil, nil otherwise. +func (a *ActionsCacheList) GetActionsCaches() []*ActionsCache { + if a == nil || a.ActionsCaches == nil { + return nil + } + return a.ActionsCaches +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsCacheList) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + // GetDirection returns the Direction field if it's non-nil, zero value otherwise. func (a *ActionsCacheListOptions) GetDirection() string { if a == nil || a.Direction == nil { @@ -182,6 +254,94 @@ func (a *ActionsCacheListOptions) GetSort() string { return *a.Sort } +// GetActiveCachesCount returns the ActiveCachesCount field. +func (a *ActionsCacheUsage) GetActiveCachesCount() int { + if a == nil { + return 0 + } + return a.ActiveCachesCount +} + +// GetActiveCachesSizeInBytes returns the ActiveCachesSizeInBytes field. +func (a *ActionsCacheUsage) GetActiveCachesSizeInBytes() int64 { + if a == nil { + return 0 + } + return a.ActiveCachesSizeInBytes +} + +// GetFullName returns the FullName field. +func (a *ActionsCacheUsage) GetFullName() string { + if a == nil { + return "" + } + return a.FullName +} + +// GetRepoCacheUsage returns the RepoCacheUsage slice if it's non-nil, nil otherwise. +func (a *ActionsCacheUsageList) GetRepoCacheUsage() []*ActionsCacheUsage { + if a == nil || a.RepoCacheUsage == nil { + return nil + } + return a.RepoCacheUsage +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsCacheUsageList) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise. +func (a *ActionsEnabledOnEnterpriseRepos) GetOrganizations() []*Organization { + if a == nil || a.Organizations == nil { + return nil + } + return a.Organizations +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsEnabledOnEnterpriseRepos) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (a *ActionsEnabledOnOrgRepos) GetRepositories() []*Repository { + if a == nil || a.Repositories == nil { + return nil + } + return a.Repositories +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsEnabledOnOrgRepos) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetFullDomains returns the FullDomains slice if it's non-nil, nil otherwise. +func (a *ActionsInboundDomains) GetFullDomains() []string { + if a == nil || a.FullDomains == nil { + return nil + } + return a.FullDomains +} + +// GetWildcardDomains returns the WildcardDomains slice if it's non-nil, nil otherwise. +func (a *ActionsInboundDomains) GetWildcardDomains() []string { + if a == nil || a.WildcardDomains == nil { + return nil + } + return a.WildcardDomains +} + // GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise. func (a *ActionsPermissions) GetAllowedActions() string { if a == nil || a.AllowedActions == nil { @@ -278,6 +438,14 @@ func (a *ActionsVariable) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetName returns the Name field. +func (a *ActionsVariable) GetName() string { + if a == nil { + return "" + } + return a.Name +} + // GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. func (a *ActionsVariable) GetSelectedRepositoriesURL() string { if a == nil || a.SelectedRepositoriesURL == nil { @@ -302,6 +470,14 @@ func (a *ActionsVariable) GetUpdatedAt() Timestamp { return *a.UpdatedAt } +// GetValue returns the Value field. +func (a *ActionsVariable) GetValue() string { + if a == nil { + return "" + } + return a.Value +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (a *ActionsVariable) GetVisibility() string { if a == nil || a.Visibility == nil { @@ -310,6 +486,22 @@ func (a *ActionsVariable) GetVisibility() string { return *a.Visibility } +// GetTotalCount returns the TotalCount field. +func (a *ActionsVariables) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetVariables returns the Variables slice if it's non-nil, nil otherwise. +func (a *ActionsVariables) GetVariables() []*ActionsVariable { + if a == nil || a.Variables == nil { + return nil + } + return a.Variables +} + // GetMaximumAdvancedSecurityCommitters returns the MaximumAdvancedSecurityCommitters field if it's non-nil, zero value otherwise. func (a *ActiveCommitters) GetMaximumAdvancedSecurityCommitters() int { if a == nil || a.MaximumAdvancedSecurityCommitters == nil { @@ -326,6 +518,14 @@ func (a *ActiveCommitters) GetPurchasedAdvancedSecurityCommitters() int { return *a.PurchasedAdvancedSecurityCommitters } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (a *ActiveCommitters) GetRepositories() []*RepositoryActiveCommitters { + if a == nil || a.Repositories == nil { + return nil + } + return a.Repositories +} + // GetTotalAdvancedSecurityCommitters returns the TotalAdvancedSecurityCommitters field if it's non-nil, zero value otherwise. func (a *ActiveCommitters) GetTotalAdvancedSecurityCommitters() int { if a == nil || a.TotalAdvancedSecurityCommitters == nil { @@ -350,6 +550,22 @@ func (a *ActiveCommittersListOptions) GetAdvancedSecurityProduct() string { return *a.AdvancedSecurityProduct } +// GetDirection returns the Direction field. +func (a *ActivityListStarredOptions) GetDirection() string { + if a == nil { + return "" + } + return a.Direction +} + +// GetSort returns the Sort field. +func (a *ActivityListStarredOptions) GetSort() string { + if a == nil { + return "" + } + return a.Sort +} + // GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise. func (a *ActorLocation) GetCountryCode() string { if a == nil || a.CountryCode == nil { @@ -382,6 +598,14 @@ func (a *AddResourcesToCostCenterResponse) GetMessage() string { return *a.Message } +// GetReassignedResources returns the ReassignedResources slice if it's non-nil, nil otherwise. +func (a *AddResourcesToCostCenterResponse) GetReassignedResources() []*ReassignedResource { + if a == nil || a.ReassignedResources == nil { + return nil + } + return a.ReassignedResources +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AdminEnforcedChanges) GetFrom() bool { if a == nil || a.From == nil { @@ -390,6 +614,14 @@ func (a *AdminEnforcedChanges) GetFrom() bool { return *a.From } +// GetEnabled returns the Enabled field. +func (a *AdminEnforcement) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (a *AdminEnforcement) GetURL() string { if a == nil || a.URL == nil { @@ -486,12 +718,36 @@ func (a *AdvancedSecurity) GetStatus() string { return *a.Status } -// GetScore returns the Score field. -func (a *AdvisoryCVSS) GetScore() *float64 { +// GetLastPushedDate returns the LastPushedDate field. +func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedDate() string { if a == nil { - return nil + return "" } - return a.Score + return a.LastPushedDate +} + +// GetLastPushedEmail returns the LastPushedEmail field. +func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedEmail() string { + if a == nil { + return "" + } + return a.LastPushedEmail +} + +// GetUserLogin returns the UserLogin field. +func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string { + if a == nil { + return "" + } + return a.UserLogin +} + +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (a *AdvisoryCVSS) GetScore() float64 { + if a == nil || a.Score == nil { + return 0 + } + return *a.Score } // GetVectorString returns the VectorString field if it's non-nil, zero value otherwise. @@ -518,6 +774,22 @@ func (a *AdvisoryCWEs) GetName() string { return *a.Name } +// GetPercentage returns the Percentage field. +func (a *AdvisoryEPSS) GetPercentage() float64 { + if a == nil { + return 0 + } + return a.Percentage +} + +// GetPercentile returns the Percentile field. +func (a *AdvisoryEPSS) GetPercentile() float64 { + if a == nil { + return 0 + } + return a.Percentile +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (a *AdvisoryIdentifier) GetType() string { if a == nil || a.Type == nil { @@ -574,6 +846,14 @@ func (a *AdvisoryVulnerability) GetSeverity() string { return *a.Severity } +// GetVulnerableFunctions returns the VulnerableFunctions slice if it's non-nil, nil otherwise. +func (a *AdvisoryVulnerability) GetVulnerableFunctions() []string { + if a == nil || a.VulnerableFunctions == nil { + return nil + } + return a.VulnerableFunctions +} + // GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise. func (a *AdvisoryVulnerability) GetVulnerableVersionRange() string { if a == nil || a.VulnerableVersionRange == nil { @@ -654,6 +934,14 @@ func (a *Alert) GetHTMLURL() string { return *a.HTMLURL } +// GetInstances returns the Instances slice if it's non-nil, nil otherwise. +func (a *Alert) GetInstances() []*MostRecentInstance { + if a == nil || a.Instances == nil { + return nil + } + return a.Instances +} + // GetInstancesURL returns the InstancesURL field if it's non-nil, zero value otherwise. func (a *Alert) GetInstancesURL() string { if a == nil || a.InstancesURL == nil { @@ -750,6 +1038,78 @@ func (a *Alert) GetURL() string { return *a.URL } +// GetRef returns the Ref field. +func (a *AlertInstancesListOptions) GetRef() string { + if a == nil { + return "" + } + return a.Ref +} + +// GetDirection returns the Direction field. +func (a *AlertListOptions) GetDirection() string { + if a == nil { + return "" + } + return a.Direction +} + +// GetRef returns the Ref field. +func (a *AlertListOptions) GetRef() string { + if a == nil { + return "" + } + return a.Ref +} + +// GetSeverity returns the Severity field. +func (a *AlertListOptions) GetSeverity() string { + if a == nil { + return "" + } + return a.Severity +} + +// GetSort returns the Sort field. +func (a *AlertListOptions) GetSort() string { + if a == nil { + return "" + } + return a.Sort +} + +// GetState returns the State field. +func (a *AlertListOptions) GetState() string { + if a == nil { + return "" + } + return a.State +} + +// GetToolGUID returns the ToolGUID field. +func (a *AlertListOptions) GetToolGUID() string { + if a == nil { + return "" + } + return a.ToolGUID +} + +// GetToolName returns the ToolName field. +func (a *AlertListOptions) GetToolName() string { + if a == nil { + return "" + } + return a.ToolName +} + +// GetEnabled returns the Enabled field. +func (a *AllowDeletions) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string { if a == nil || a.From == nil { @@ -758,6 +1118,14 @@ func (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string { return *a.From } +// GetEnabled returns the Enabled field. +func (a *AllowForcePushes) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + // GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. func (a *AllowForkSyncing) GetEnabled() bool { if a == nil || a.Enabled == nil { @@ -766,6 +1134,94 @@ func (a *AllowForkSyncing) GetEnabled() bool { return *a.Enabled } +// GetAuthenticationType returns the AuthenticationType field. +func (a *AmazonS3AccessKeysConfig) GetAuthenticationType() string { + if a == nil { + return "" + } + return a.AuthenticationType +} + +// GetBucket returns the Bucket field. +func (a *AmazonS3AccessKeysConfig) GetBucket() string { + if a == nil { + return "" + } + return a.Bucket +} + +// GetEncryptedAccessKeyID returns the EncryptedAccessKeyID field. +func (a *AmazonS3AccessKeysConfig) GetEncryptedAccessKeyID() string { + if a == nil { + return "" + } + return a.EncryptedAccessKeyID +} + +// GetEncryptedSecretKey returns the EncryptedSecretKey field. +func (a *AmazonS3AccessKeysConfig) GetEncryptedSecretKey() string { + if a == nil { + return "" + } + return a.EncryptedSecretKey +} + +// GetKeyID returns the KeyID field. +func (a *AmazonS3AccessKeysConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetRegion returns the Region field. +func (a *AmazonS3AccessKeysConfig) GetRegion() string { + if a == nil { + return "" + } + return a.Region +} + +// GetArnRole returns the ArnRole field. +func (a *AmazonS3OIDCConfig) GetArnRole() string { + if a == nil { + return "" + } + return a.ArnRole +} + +// GetAuthenticationType returns the AuthenticationType field. +func (a *AmazonS3OIDCConfig) GetAuthenticationType() string { + if a == nil { + return "" + } + return a.AuthenticationType +} + +// GetBucket returns the Bucket field. +func (a *AmazonS3OIDCConfig) GetBucket() string { + if a == nil { + return "" + } + return a.Bucket +} + +// GetKeyID returns the KeyID field. +func (a *AmazonS3OIDCConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetRegion returns the Region field. +func (a *AmazonS3OIDCConfig) GetRegion() string { + if a == nil { + return "" + } + return a.Region +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (a *AnalysesListOptions) GetRef() string { if a == nil || a.Ref == nil { @@ -782,6 +1238,54 @@ func (a *AnalysesListOptions) GetSarifID() string { return *a.SarifID } +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetActions() []string { + if a == nil || a.Actions == nil { + return nil + } + return a.Actions +} + +// GetActionsMacos returns the ActionsMacos slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetActionsMacos() []string { + if a == nil || a.ActionsMacos == nil { + return nil + } + return a.ActionsMacos +} + +// GetAPI returns the API slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetAPI() []string { + if a == nil || a.API == nil { + return nil + } + return a.API +} + +// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetCodespaces() []string { + if a == nil || a.Codespaces == nil { + return nil + } + return a.Codespaces +} + +// GetCopilot returns the Copilot slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetCopilot() []string { + if a == nil || a.Copilot == nil { + return nil + } + return a.Copilot +} + +// GetDependabot returns the Dependabot slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetDependabot() []string { + if a == nil || a.Dependabot == nil { + return nil + } + return a.Dependabot +} + // GetDomains returns the Domains field. func (a *APIMeta) GetDomains() *APIMetaDomains { if a == nil { @@ -790,6 +1294,54 @@ func (a *APIMeta) GetDomains() *APIMetaDomains { return a.Domains } +// GetGit returns the Git slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetGit() []string { + if a == nil || a.Git == nil { + return nil + } + return a.Git +} + +// GetGithubEnterpriseImporter returns the GithubEnterpriseImporter slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetGithubEnterpriseImporter() []string { + if a == nil || a.GithubEnterpriseImporter == nil { + return nil + } + return a.GithubEnterpriseImporter +} + +// GetHooks returns the Hooks slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetHooks() []string { + if a == nil || a.Hooks == nil { + return nil + } + return a.Hooks +} + +// GetImporter returns the Importer slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetImporter() []string { + if a == nil || a.Importer == nil { + return nil + } + return a.Importer +} + +// GetPackages returns the Packages slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetPackages() []string { + if a == nil || a.Packages == nil { + return nil + } + return a.Packages +} + +// GetPages returns the Pages slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetPages() []string { + if a == nil || a.Pages == nil { + return nil + } + return a.Pages +} + // GetSSHKeyFingerprints returns the SSHKeyFingerprints map if it's non-nil, an empty map otherwise. func (a *APIMeta) GetSSHKeyFingerprints() map[string]string { if a == nil || a.SSHKeyFingerprints == nil { @@ -798,6 +1350,14 @@ func (a *APIMeta) GetSSHKeyFingerprints() map[string]string { return a.SSHKeyFingerprints } +// GetSSHKeys returns the SSHKeys slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetSSHKeys() []string { + if a == nil || a.SSHKeys == nil { + return nil + } + return a.SSHKeys +} + // GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise. func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { if a == nil || a.VerifiablePasswordAuthentication == nil { @@ -806,6 +1366,46 @@ func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { return *a.VerifiablePasswordAuthentication } +// GetWeb returns the Web slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetWeb() []string { + if a == nil || a.Web == nil { + return nil + } + return a.Web +} + +// GetServices returns the Services slice if it's non-nil, nil otherwise. +func (a *APIMetaArtifactAttestations) GetServices() []string { + if a == nil || a.Services == nil { + return nil + } + return a.Services +} + +// GetTrustDomain returns the TrustDomain field. +func (a *APIMetaArtifactAttestations) GetTrustDomain() string { + if a == nil { + return "" + } + return a.TrustDomain +} + +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetActions() []string { + if a == nil || a.Actions == nil { + return nil + } + return a.Actions +} + +// GetActionsInbound returns the ActionsInbound field. +func (a *APIMetaDomains) GetActionsInbound() *ActionsInboundDomains { + if a == nil { + return nil + } + return a.ActionsInbound +} + // GetArtifactAttestations returns the ArtifactAttestations field. func (a *APIMetaDomains) GetArtifactAttestations() *APIMetaArtifactAttestations { if a == nil { @@ -814,6 +1414,46 @@ func (a *APIMetaDomains) GetArtifactAttestations() *APIMetaArtifactAttestations return a.ArtifactAttestations } +// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetCodespaces() []string { + if a == nil || a.Codespaces == nil { + return nil + } + return a.Codespaces +} + +// GetCopilot returns the Copilot slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetCopilot() []string { + if a == nil || a.Copilot == nil { + return nil + } + return a.Copilot +} + +// GetPackages returns the Packages slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetPackages() []string { + if a == nil || a.Packages == nil { + return nil + } + return a.Packages +} + +// GetWebsite returns the Website slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetWebsite() []string { + if a == nil || a.Website == nil { + return nil + } + return a.Website +} + +// GetClientID returns the ClientID field if it's non-nil, zero value otherwise. +func (a *App) GetClientID() string { + if a == nil || a.ClientID == nil { + return "" + } + return *a.ClientID +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (a *App) GetCreatedAt() Timestamp { if a == nil || a.CreatedAt == nil { @@ -830,6 +1470,14 @@ func (a *App) GetDescription() string { return *a.Description } +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (a *App) GetEvents() []string { + if a == nil || a.Events == nil { + return nil + } + return a.Events +} + // GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise. func (a *App) GetExternalURL() string { if a == nil || a.ExternalURL == nil { @@ -1022,6 +1670,14 @@ func (a *AppConfig) GetWebhookSecret() string { return *a.WebhookSecret } +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (a *AppInstallationRepositoriesOptions) GetSelectedRepositoryIDs() []int64 { + if a == nil || a.SelectedRepositoryIDs == nil { + return nil + } + return a.SelectedRepositoryIDs +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *ArchivedAt) GetFrom() Timestamp { if a == nil || a.From == nil { @@ -1134,6 +1790,118 @@ func (a *Artifact) GetWorkflowRun() *ArtifactWorkflowRun { return a.WorkflowRun } +// GetAttestationID returns the AttestationID field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetAttestationID() int64 { + if a == nil || a.AttestationID == nil { + return 0 + } + return *a.AttestationID +} + +// GetCluster returns the Cluster field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetCluster() string { + if a == nil || a.Cluster == nil { + return "" + } + return *a.Cluster +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetCreatedAt() Timestamp { + if a == nil || a.CreatedAt == nil { + return Timestamp{} + } + return *a.CreatedAt +} + +// GetDeploymentName returns the DeploymentName field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetDeploymentName() string { + if a == nil || a.DeploymentName == nil { + return "" + } + return *a.DeploymentName +} + +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetDigest() string { + if a == nil || a.Digest == nil { + return "" + } + return *a.Digest +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetID() int64 { + if a == nil || a.ID == nil { + return 0 + } + return *a.ID +} + +// GetLogicalEnvironment returns the LogicalEnvironment field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetLogicalEnvironment() string { + if a == nil || a.LogicalEnvironment == nil { + return "" + } + return *a.LogicalEnvironment +} + +// GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetPhysicalEnvironment() string { + if a == nil || a.PhysicalEnvironment == nil { + return "" + } + return *a.PhysicalEnvironment +} + +// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise. +func (a *ArtifactDeploymentRecord) GetRuntimeRisks() []DeploymentRuntimeRisk { + if a == nil || a.RuntimeRisks == nil { + return nil + } + return a.RuntimeRisks +} + +// GetTags returns the Tags map if it's non-nil, an empty map otherwise. +func (a *ArtifactDeploymentRecord) GetTags() map[string]string { + if a == nil || a.Tags == nil { + return map[string]string{} + } + return a.Tags +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentRecord) GetUpdatedAt() Timestamp { + if a == nil || a.UpdatedAt == nil { + return Timestamp{} + } + return *a.UpdatedAt +} + +// GetDeploymentRecords returns the DeploymentRecords slice if it's non-nil, nil otherwise. +func (a *ArtifactDeploymentResponse) GetDeploymentRecords() []*ArtifactDeploymentRecord { + if a == nil || a.DeploymentRecords == nil { + return nil + } + return a.DeploymentRecords +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (a *ArtifactDeploymentResponse) GetTotalCount() int { + if a == nil || a.TotalCount == nil { + return 0 + } + return *a.TotalCount +} + +// GetArtifacts returns the Artifacts slice if it's non-nil, nil otherwise. +func (a *ArtifactList) GetArtifacts() []*Artifact { + if a == nil || a.Artifacts == nil { + return nil + } + return a.Artifacts +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (a *ArtifactList) GetTotalCount() int64 { if a == nil || a.TotalCount == nil { @@ -1166,6 +1934,94 @@ func (a *ArtifactPeriodOpt) GetDays() int { return *a.Days } +// GetArtifactURL returns the ArtifactURL field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetArtifactURL() string { + if a == nil || a.ArtifactURL == nil { + return "" + } + return *a.ArtifactURL +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetCreatedAt() Timestamp { + if a == nil || a.CreatedAt == nil { + return Timestamp{} + } + return *a.CreatedAt +} + +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetDigest() string { + if a == nil || a.Digest == nil { + return "" + } + return *a.Digest +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetID() int64 { + if a == nil || a.ID == nil { + return 0 + } + return *a.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetName() string { + if a == nil || a.Name == nil { + return "" + } + return *a.Name +} + +// GetRegistryURL returns the RegistryURL field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetRegistryURL() string { + if a == nil || a.RegistryURL == nil { + return "" + } + return *a.RegistryURL +} + +// GetRepository returns the Repository field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetRepository() string { + if a == nil || a.Repository == nil { + return "" + } + return *a.Repository +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetStatus() string { + if a == nil || a.Status == nil { + return "" + } + return *a.Status +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageRecord) GetUpdatedAt() Timestamp { + if a == nil || a.UpdatedAt == nil { + return Timestamp{} + } + return *a.UpdatedAt +} + +// GetStorageRecords returns the StorageRecords slice if it's non-nil, nil otherwise. +func (a *ArtifactStorageResponse) GetStorageRecords() []*ArtifactStorageRecord { + if a == nil || a.StorageRecords == nil { + return nil + } + return a.StorageRecords +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (a *ArtifactStorageResponse) GetTotalCount() int { + if a == nil || a.TotalCount == nil { + return 0 + } + return *a.TotalCount +} + // GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. func (a *ArtifactWorkflowRun) GetHeadBranch() string { if a == nil || a.HeadBranch == nil { @@ -1318,6 +2174,30 @@ func (a *Attachment) GetTitle() string { return *a.Title } +// GetBundle returns the Bundle field. +func (a *Attestation) GetBundle() json.RawMessage { + if a == nil { + return json.RawMessage{} + } + return a.Bundle +} + +// GetRepositoryID returns the RepositoryID field. +func (a *Attestation) GetRepositoryID() int64 { + if a == nil { + return 0 + } + return a.RepositoryID +} + +// GetAttestations returns the Attestations slice if it's non-nil, nil otherwise. +func (a *AttestationsResponse) GetAttestations() []*Attestation { + if a == nil || a.Attestations == nil { + return nil + } + return a.Attestations +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetAction() string { if a == nil || a.Action == nil { @@ -1478,6 +2358,102 @@ func (a *AuditEntry) GetUserID() int64 { return *a.UserID } +// GetCreatedAt returns the CreatedAt field. +func (a *AuditLogStream) GetCreatedAt() Timestamp { + if a == nil { + return Timestamp{} + } + return a.CreatedAt +} + +// GetEnabled returns the Enabled field. +func (a *AuditLogStream) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + +// GetID returns the ID field. +func (a *AuditLogStream) GetID() int64 { + if a == nil { + return 0 + } + return a.ID +} + +// GetPausedAt returns the PausedAt field if it's non-nil, zero value otherwise. +func (a *AuditLogStream) GetPausedAt() Timestamp { + if a == nil || a.PausedAt == nil { + return Timestamp{} + } + return *a.PausedAt +} + +// GetStreamDetails returns the StreamDetails field. +func (a *AuditLogStream) GetStreamDetails() string { + if a == nil { + return "" + } + return a.StreamDetails +} + +// GetStreamType returns the StreamType field. +func (a *AuditLogStream) GetStreamType() string { + if a == nil { + return "" + } + return a.StreamType +} + +// GetUpdatedAt returns the UpdatedAt field. +func (a *AuditLogStream) GetUpdatedAt() Timestamp { + if a == nil { + return Timestamp{} + } + return a.UpdatedAt +} + +// GetEnabled returns the Enabled field. +func (a *AuditLogStreamConfig) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + +// GetStreamType returns the StreamType field. +func (a *AuditLogStreamConfig) GetStreamType() string { + if a == nil { + return "" + } + return a.StreamType +} + +// GetVendorSpecific returns the VendorSpecific field. +func (a *AuditLogStreamConfig) GetVendorSpecific() AuditLogStreamVendorConfig { + if a == nil { + return nil + } + return a.VendorSpecific +} + +// GetKey returns the Key field. +func (a *AuditLogStreamKey) GetKey() string { + if a == nil { + return "" + } + return a.Key +} + +// GetKeyID returns the KeyID field. +func (a *AuditLogStreamKey) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + // GetApp returns the App field. func (a *Authorization) GetApp() *AuthorizationApp { if a == nil { @@ -1534,6 +2510,14 @@ func (a *Authorization) GetNoteURL() string { return *a.NoteURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (a *Authorization) GetScopes() []Scope { + if a == nil || a.Scopes == nil { + return nil + } + return a.Scopes +} + // GetToken returns the Token field if it's non-nil, zero value otherwise. func (a *Authorization) GetToken() string { if a == nil || a.Token == nil { @@ -1638,6 +2622,22 @@ func (a *AuthorizationRequest) GetNoteURL() string { return *a.NoteURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationRequest) GetScopes() []Scope { + if a == nil || a.Scopes == nil { + return nil + } + return a.Scopes +} + +// GetAddScopes returns the AddScopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationUpdateRequest) GetAddScopes() []string { + if a == nil || a.AddScopes == nil { + return nil + } + return a.AddScopes +} + // GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. func (a *AuthorizationUpdateRequest) GetFingerprint() string { if a == nil || a.Fingerprint == nil { @@ -1662,6 +2662,30 @@ func (a *AuthorizationUpdateRequest) GetNoteURL() string { return *a.NoteURL } +// GetRemoveScopes returns the RemoveScopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationUpdateRequest) GetRemoveScopes() []string { + if a == nil || a.RemoveScopes == nil { + return nil + } + return a.RemoveScopes +} + +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationUpdateRequest) GetScopes() []string { + if a == nil || a.Scopes == nil { + return nil + } + return a.Scopes +} + +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (a *AuthorizedActorNames) GetFrom() []string { + if a == nil || a.From == nil { + return nil + } + return a.From +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AuthorizedActorsOnly) GetFrom() bool { if a == nil || a.From == nil { @@ -1766,6 +2790,78 @@ func (a *AutoTriggerCheck) GetSetting() bool { return *a.Setting } +// GetContainer returns the Container field. +func (a *AzureBlobConfig) GetContainer() string { + if a == nil { + return "" + } + return a.Container +} + +// GetEncryptedSASURL returns the EncryptedSASURL field. +func (a *AzureBlobConfig) GetEncryptedSASURL() string { + if a == nil { + return "" + } + return a.EncryptedSASURL +} + +// GetKeyID returns the KeyID field. +func (a *AzureBlobConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetEncryptedConnstring returns the EncryptedConnstring field. +func (a *AzureHubConfig) GetEncryptedConnstring() string { + if a == nil { + return "" + } + return a.EncryptedConnstring +} + +// GetKeyID returns the KeyID field. +func (a *AzureHubConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetName returns the Name field. +func (a *AzureHubConfig) GetName() string { + if a == nil { + return "" + } + return a.Name +} + +// GetOTP returns the OTP field. +func (b *BasicAuthTransport) GetOTP() string { + if b == nil { + return "" + } + return b.OTP +} + +// GetPassword returns the Password field. +func (b *BasicAuthTransport) GetPassword() string { + if b == nil { + return "" + } + return b.Password +} + +// GetUsername returns the Username field. +func (b *BasicAuthTransport) GetUsername() string { + if b == nil { + return "" + } + return b.Username +} + // GetContent returns the Content field if it's non-nil, zero value otherwise. func (b *Blob) GetContent() string { if b == nil || b.Content == nil { @@ -1982,6 +3078,14 @@ func (b *BranchProtectionRule) GetAllowForcePushesEnforcementLevel() string { return *b.AllowForcePushesEnforcementLevel } +// GetAuthorizedActorNames returns the AuthorizedActorNames slice if it's non-nil, nil otherwise. +func (b *BranchProtectionRule) GetAuthorizedActorNames() []string { + if b == nil || b.AuthorizedActorNames == nil { + return nil + } + return b.AuthorizedActorNames +} + // GetAuthorizedActorsOnly returns the AuthorizedActorsOnly field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetAuthorizedActorsOnly() bool { if b == nil || b.AuthorizedActorsOnly == nil { @@ -2102,6 +3206,14 @@ func (b *BranchProtectionRule) GetRequiredDeploymentsEnforcementLevel() string { return *b.RequiredDeploymentsEnforcementLevel } +// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise. +func (b *BranchProtectionRule) GetRequiredStatusChecks() []string { + if b == nil || b.RequiredStatusChecks == nil { + return nil + } + return b.RequiredStatusChecks +} + // GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel() string { if b == nil || b.RequiredStatusChecksEnforcementLevel == nil { @@ -2198,6 +3310,254 @@ func (b *BranchProtectionRuleEvent) GetSender() *User { return b.Sender } +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BranchRestrictions) GetApps() []*App { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BranchRestrictions) GetTeams() []*Team { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BranchRestrictions) GetUsers() []*User { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BranchRestrictionsRequest) GetApps() []string { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BranchRestrictionsRequest) GetTeams() []string { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BranchRestrictionsRequest) GetUsers() []string { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetRulesetID returns the RulesetID field. +func (b *BranchRuleMetadata) GetRulesetID() int64 { + if b == nil { + return 0 + } + return b.RulesetID +} + +// GetRulesetSource returns the RulesetSource field. +func (b *BranchRuleMetadata) GetRulesetSource() string { + if b == nil { + return "" + } + return b.RulesetSource +} + +// GetRulesetSourceType returns the RulesetSourceType field. +func (b *BranchRuleMetadata) GetRulesetSourceType() RulesetSourceType { + if b == nil { + return "" + } + return b.RulesetSourceType +} + +// GetBranchNamePattern returns the BranchNamePattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetBranchNamePattern() []*PatternBranchRule { + if b == nil || b.BranchNamePattern == nil { + return nil + } + return b.BranchNamePattern +} + +// GetCodeScanning returns the CodeScanning slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCodeScanning() []*CodeScanningBranchRule { + if b == nil || b.CodeScanning == nil { + return nil + } + return b.CodeScanning +} + +// GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCommitAuthorEmailPattern() []*PatternBranchRule { + if b == nil || b.CommitAuthorEmailPattern == nil { + return nil + } + return b.CommitAuthorEmailPattern +} + +// GetCommitMessagePattern returns the CommitMessagePattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCommitMessagePattern() []*PatternBranchRule { + if b == nil || b.CommitMessagePattern == nil { + return nil + } + return b.CommitMessagePattern +} + +// GetCommitterEmailPattern returns the CommitterEmailPattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCommitterEmailPattern() []*PatternBranchRule { + if b == nil || b.CommitterEmailPattern == nil { + return nil + } + return b.CommitterEmailPattern +} + +// GetCopilotCodeReview returns the CopilotCodeReview slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCopilotCodeReview() []*CopilotCodeReviewBranchRule { + if b == nil || b.CopilotCodeReview == nil { + return nil + } + return b.CopilotCodeReview +} + +// GetCreation returns the Creation slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCreation() []*BranchRuleMetadata { + if b == nil || b.Creation == nil { + return nil + } + return b.Creation +} + +// GetDeletion returns the Deletion slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetDeletion() []*BranchRuleMetadata { + if b == nil || b.Deletion == nil { + return nil + } + return b.Deletion +} + +// GetFileExtensionRestriction returns the FileExtensionRestriction slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetFileExtensionRestriction() []*FileExtensionRestrictionBranchRule { + if b == nil || b.FileExtensionRestriction == nil { + return nil + } + return b.FileExtensionRestriction +} + +// GetFilePathRestriction returns the FilePathRestriction slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetFilePathRestriction() []*FilePathRestrictionBranchRule { + if b == nil || b.FilePathRestriction == nil { + return nil + } + return b.FilePathRestriction +} + +// GetMaxFilePathLength returns the MaxFilePathLength slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetMaxFilePathLength() []*MaxFilePathLengthBranchRule { + if b == nil || b.MaxFilePathLength == nil { + return nil + } + return b.MaxFilePathLength +} + +// GetMaxFileSize returns the MaxFileSize slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetMaxFileSize() []*MaxFileSizeBranchRule { + if b == nil || b.MaxFileSize == nil { + return nil + } + return b.MaxFileSize +} + +// GetMergeQueue returns the MergeQueue slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetMergeQueue() []*MergeQueueBranchRule { + if b == nil || b.MergeQueue == nil { + return nil + } + return b.MergeQueue +} + +// GetNonFastForward returns the NonFastForward slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetNonFastForward() []*BranchRuleMetadata { + if b == nil || b.NonFastForward == nil { + return nil + } + return b.NonFastForward +} + +// GetPullRequest returns the PullRequest slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetPullRequest() []*PullRequestBranchRule { + if b == nil || b.PullRequest == nil { + return nil + } + return b.PullRequest +} + +// GetRequiredDeployments returns the RequiredDeployments slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredDeployments() []*RequiredDeploymentsBranchRule { + if b == nil || b.RequiredDeployments == nil { + return nil + } + return b.RequiredDeployments +} + +// GetRequiredLinearHistory returns the RequiredLinearHistory slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredLinearHistory() []*BranchRuleMetadata { + if b == nil || b.RequiredLinearHistory == nil { + return nil + } + return b.RequiredLinearHistory +} + +// GetRequiredSignatures returns the RequiredSignatures slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredSignatures() []*BranchRuleMetadata { + if b == nil || b.RequiredSignatures == nil { + return nil + } + return b.RequiredSignatures +} + +// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredStatusChecks() []*RequiredStatusChecksBranchRule { + if b == nil || b.RequiredStatusChecks == nil { + return nil + } + return b.RequiredStatusChecks +} + +// GetTagNamePattern returns the TagNamePattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetTagNamePattern() []*PatternBranchRule { + if b == nil || b.TagNamePattern == nil { + return nil + } + return b.TagNamePattern +} + +// GetUpdate returns the Update slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetUpdate() []*UpdateBranchRule { + if b == nil || b.Update == nil { + return nil + } + return b.Update +} + +// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetWorkflows() []*WorkflowsBranchRule { + if b == nil || b.Workflows == nil { + return nil + } + return b.Workflows +} + // GetActorID returns the ActorID field if it's non-nil, zero value otherwise. func (b *BypassActor) GetActorID() int64 { if b == nil || b.ActorID == nil { @@ -2222,6 +3582,70 @@ func (b *BypassActor) GetBypassMode() *BypassMode { return b.BypassMode } +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowances) GetApps() []*App { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowances) GetTeams() []*Team { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowances) GetUsers() []*User { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowancesRequest) GetApps() []string { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowancesRequest) GetTeams() []string { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowancesRequest) GetUsers() []string { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetReviewerID returns the ReviewerID field. +func (b *BypassReviewer) GetReviewerID() int64 { + if b == nil { + return 0 + } + return b.ReviewerID +} + +// GetReviewerType returns the ReviewerType field. +func (b *BypassReviewer) GetReviewerType() string { + if b == nil { + return "" + } + return b.ReviewerType +} + // GetSecurityConfigurationID returns the SecurityConfigurationID field if it's non-nil, zero value otherwise. func (b *BypassReviewer) GetSecurityConfigurationID() int64 { if b == nil || b.SecurityConfigurationID == nil { @@ -2326,6 +3750,14 @@ func (c *CheckRun) GetOutput() *CheckRunOutput { return c.Output } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (c *CheckRun) GetPullRequests() []*PullRequest { + if c == nil || c.PullRequests == nil { + return nil + } + return c.PullRequests +} + // GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. func (c *CheckRun) GetStartedAt() Timestamp { if c == nil || c.StartedAt == nil { @@ -2350,6 +3782,30 @@ func (c *CheckRun) GetURL() string { return *c.URL } +// GetDescription returns the Description field. +func (c *CheckRunAction) GetDescription() string { + if c == nil { + return "" + } + return c.Description +} + +// GetIdentifier returns the Identifier field. +func (c *CheckRunAction) GetIdentifier() string { + if c == nil { + return "" + } + return c.Identifier +} + +// GetLabel returns the Label field. +func (c *CheckRunAction) GetLabel() string { + if c == nil { + return "" + } + return c.Label +} + // GetAnnotationLevel returns the AnnotationLevel field if it's non-nil, zero value otherwise. func (c *CheckRunAnnotation) GetAnnotationLevel() string { if c == nil || c.AnnotationLevel == nil { @@ -2502,6 +3958,14 @@ func (c *CheckRunImage) GetImageURL() string { return *c.ImageURL } +// GetAnnotations returns the Annotations slice if it's non-nil, nil otherwise. +func (c *CheckRunOutput) GetAnnotations() []*CheckRunAnnotation { + if c == nil || c.Annotations == nil { + return nil + } + return c.Annotations +} + // GetAnnotationsCount returns the AnnotationsCount field if it's non-nil, zero value otherwise. func (c *CheckRunOutput) GetAnnotationsCount() int { if c == nil || c.AnnotationsCount == nil { @@ -2518,6 +3982,14 @@ func (c *CheckRunOutput) GetAnnotationsURL() string { return *c.AnnotationsURL } +// GetImages returns the Images slice if it's non-nil, nil otherwise. +func (c *CheckRunOutput) GetImages() []*CheckRunImage { + if c == nil || c.Images == nil { + return nil + } + return c.Images +} + // GetSummary returns the Summary field if it's non-nil, zero value otherwise. func (c *CheckRunOutput) GetSummary() string { if c == nil || c.Summary == nil { @@ -2630,6 +4102,14 @@ func (c *CheckSuite) GetNodeID() string { return *c.NodeID } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (c *CheckSuite) GetPullRequests() []*PullRequest { + if c == nil || c.PullRequests == nil { + return nil + } + return c.PullRequests +} + // GetRepository returns the Repository field. func (c *CheckSuite) GetRepository() *Repository { if c == nil { @@ -2726,6 +4206,14 @@ func (c *CheckSuiteEvent) GetSender() *User { return c.Sender } +// GetAutoTriggerChecks returns the AutoTriggerChecks slice if it's non-nil, nil otherwise. +func (c *CheckSuitePreferenceOptions) GetAutoTriggerChecks() []*AutoTriggerCheck { + if c == nil || c.AutoTriggerChecks == nil { + return nil + } + return c.AutoTriggerChecks +} + // GetPreferences returns the Preferences field. func (c *CheckSuitePreferenceResults) GetPreferences() *PreferenceList { if c == nil { @@ -2966,6 +4454,94 @@ func (c *ClassroomUser) GetLogin() string { return *c.Login } +// GetDeploymentName returns the DeploymentName field. +func (c *ClusterArtifactDeployment) GetDeploymentName() string { + if c == nil { + return "" + } + return c.DeploymentName +} + +// GetDigest returns the Digest field. +func (c *ClusterArtifactDeployment) GetDigest() string { + if c == nil { + return "" + } + return c.Digest +} + +// GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise. +func (c *ClusterArtifactDeployment) GetGithubRepository() string { + if c == nil || c.GithubRepository == nil { + return "" + } + return *c.GithubRepository +} + +// GetName returns the Name field. +func (c *ClusterArtifactDeployment) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise. +func (c *ClusterArtifactDeployment) GetRuntimeRisks() []DeploymentRuntimeRisk { + if c == nil || c.RuntimeRisks == nil { + return nil + } + return c.RuntimeRisks +} + +// GetStatus returns the Status field. +func (c *ClusterArtifactDeployment) GetStatus() string { + if c == nil { + return "" + } + return c.Status +} + +// GetTags returns the Tags map if it's non-nil, an empty map otherwise. +func (c *ClusterArtifactDeployment) GetTags() map[string]string { + if c == nil || c.Tags == nil { + return map[string]string{} + } + return c.Tags +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (c *ClusterArtifactDeployment) GetVersion() string { + if c == nil || c.Version == nil { + return "" + } + return *c.Version +} + +// GetDeployments returns the Deployments slice if it's non-nil, nil otherwise. +func (c *ClusterDeploymentRecordsRequest) GetDeployments() []*ClusterArtifactDeployment { + if c == nil || c.Deployments == nil { + return nil + } + return c.Deployments +} + +// GetLogicalEnvironment returns the LogicalEnvironment field. +func (c *ClusterDeploymentRecordsRequest) GetLogicalEnvironment() string { + if c == nil { + return "" + } + return c.LogicalEnvironment +} + +// GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise. +func (c *ClusterDeploymentRecordsRequest) GetPhysicalEnvironment() string { + if c == nil || c.PhysicalEnvironment == nil { + return "" + } + return *c.PhysicalEnvironment +} + // GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. func (c *ClusterSSHKey) GetFingerprint() string { if c == nil || c.Fingerprint == nil { @@ -2982,6 +4558,14 @@ func (c *ClusterSSHKey) GetKey() string { return *c.Key } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (c *ClusterStatus) GetNodes() []*ClusterStatusNode { + if c == nil || c.Nodes == nil { + return nil + } + return c.Nodes +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (c *ClusterStatus) GetStatus() string { if c == nil || c.Status == nil { @@ -2998,6 +4582,14 @@ func (c *ClusterStatusNode) GetHostname() string { return *c.Hostname } +// GetServices returns the Services slice if it's non-nil, nil otherwise. +func (c *ClusterStatusNode) GetServices() []*ClusterStatusNodeServiceItem { + if c == nil || c.Services == nil { + return nil + } + return c.Services +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (c *ClusterStatusNode) GetStatus() string { if c == nil || c.Status == nil { @@ -3062,6 +4654,54 @@ func (c *CodeOfConduct) GetURL() string { return *c.URL } +// GetColumn returns the Column field. +func (c *CodeownersError) GetColumn() int { + if c == nil { + return 0 + } + return c.Column +} + +// GetKind returns the Kind field. +func (c *CodeownersError) GetKind() string { + if c == nil { + return "" + } + return c.Kind +} + +// GetLine returns the Line field. +func (c *CodeownersError) GetLine() int { + if c == nil { + return 0 + } + return c.Line +} + +// GetMessage returns the Message field. +func (c *CodeownersError) GetMessage() string { + if c == nil { + return "" + } + return c.Message +} + +// GetPath returns the Path field. +func (c *CodeownersError) GetPath() string { + if c == nil { + return "" + } + return c.Path +} + +// GetSource returns the Source field. +func (c *CodeownersError) GetSource() string { + if c == nil { + return "" + } + return c.Source +} + // GetSuggestion returns the Suggestion field if it's non-nil, zero value otherwise. func (c *CodeownersError) GetSuggestion() string { if c == nil || c.Suggestion == nil { @@ -3070,6 +4710,14 @@ func (c *CodeownersError) GetSuggestion() string { return *c.Suggestion } +// GetErrors returns the Errors slice if it's non-nil, nil otherwise. +func (c *CodeownersErrors) GetErrors() []*CodeownersError { + if c == nil || c.Errors == nil { + return nil + } + return c.Errors +} + // GetContentType returns the ContentType field if it's non-nil, zero value otherwise. func (c *CodeQLDatabase) GetContentType() string { if c == nil || c.ContentType == nil { @@ -3182,6 +4830,14 @@ func (c *CodeResult) GetSHA() string { return *c.SHA } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (c *CodeResult) GetTextMatches() []*TextMatch { + if c == nil || c.TextMatches == nil { + return nil + } + return c.TextMatches +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (c *CodeScanningAlertEvent) GetAction() string { if c == nil || c.Action == nil { @@ -3262,6 +4918,22 @@ func (c *CodeScanningAlertState) GetDismissedReason() string { return *c.DismissedReason } +// GetState returns the State field. +func (c *CodeScanningAlertState) GetState() string { + if c == nil { + return "" + } + return c.State +} + +// GetParameters returns the Parameters field. +func (c *CodeScanningBranchRule) GetParameters() CodeScanningRuleParameters { + if c == nil { + return CodeScanningRuleParameters{} + } + return c.Parameters +} + // GetRunnerLabel returns the RunnerLabel field if it's non-nil, zero value otherwise. func (c *CodeScanningDefaultSetupOptions) GetRunnerLabel() string { if c == nil || c.RunnerLabel == nil { @@ -3270,6 +4942,14 @@ func (c *CodeScanningDefaultSetupOptions) GetRunnerLabel() string { return *c.RunnerLabel } +// GetRunnerType returns the RunnerType field. +func (c *CodeScanningDefaultSetupOptions) GetRunnerType() string { + if c == nil { + return "" + } + return c.RunnerType +} + // GetAllowAdvanced returns the AllowAdvanced field if it's non-nil, zero value otherwise. func (c *CodeScanningOptions) GetAllowAdvanced() bool { if c == nil || c.AllowAdvanced == nil { @@ -3278,6 +4958,22 @@ func (c *CodeScanningOptions) GetAllowAdvanced() bool { return *c.AllowAdvanced } +// GetCodeScanningTools returns the CodeScanningTools slice if it's non-nil, nil otherwise. +func (c *CodeScanningRuleParameters) GetCodeScanningTools() []*RuleCodeScanningTool { + if c == nil || c.CodeScanningTools == nil { + return nil + } + return c.CodeScanningTools +} + +// GetCodeResults returns the CodeResults slice if it's non-nil, nil otherwise. +func (c *CodeSearchResult) GetCodeResults() []*CodeResult { + if c == nil || c.CodeResults == nil { + return nil + } + return c.CodeResults +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (c *CodeSearchResult) GetIncompleteResults() bool { if c == nil || c.IncompleteResults == nil { @@ -3294,6 +4990,14 @@ func (c *CodeSearchResult) GetTotal() int { return *c.Total } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *CodeSecurity) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + // GetAdvancedSecurity returns the AdvancedSecurity field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetAdvancedSecurity() string { if c == nil || c.AdvancedSecurity == nil { @@ -3390,6 +5094,14 @@ func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions() return c.DependencyGraphAutosubmitActionOptions } +// GetDescription returns the Description field. +func (c *CodeSecurityConfiguration) GetDescription() string { + if c == nil { + return "" + } + return c.Description +} + // GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetEnforcement() string { if c == nil || c.Enforcement == nil { @@ -3414,6 +5126,14 @@ func (c *CodeSecurityConfiguration) GetID() int64 { return *c.ID } +// GetName returns the Name field. +func (c *CodeSecurityConfiguration) GetName() string { + if c == nil { + return "" + } + return c.Name +} + // GetPrivateVulnerabilityReporting returns the PrivateVulnerabilityReporting field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetPrivateVulnerabilityReporting() string { if c == nil || c.PrivateVulnerabilityReporting == nil { @@ -3694,6 +5414,14 @@ func (c *Codespace) GetPullsURL() string { return *c.PullsURL } +// GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise. +func (c *Codespace) GetRecentFolders() []string { + if c == nil || c.RecentFolders == nil { + return nil + } + return c.RecentFolders +} + // GetRepository returns the Repository field. func (c *Codespace) GetRepository() *Repository { if c == nil { @@ -3854,6 +5582,14 @@ func (c *CodespaceCreateForUserOptions) GetRef() string { return *c.Ref } +// GetRepositoryID returns the RepositoryID field. +func (c *CodespaceCreateForUserOptions) GetRepositoryID() int64 { + if c == nil { + return 0 + } + return c.RepositoryID +} + // GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. func (c *CodespaceCreateForUserOptions) GetRetentionPeriodMinutes() int { if c == nil || c.RetentionPeriodMinutes == nil { @@ -3894,6 +5630,14 @@ func (c *CodespaceDefaults) GetDevcontainerPath() string { return *c.DevcontainerPath } +// GetLocation returns the Location field. +func (c *CodespaceDefaults) GetLocation() string { + if c == nil { + return "" + } + return c.Location +} + // GetBranch returns the Branch field if it's non-nil, zero value otherwise. func (c *CodespaceExport) GetBranch() string { if c == nil || c.Branch == nil { @@ -3966,6 +5710,30 @@ func (c *CodespaceGetDefaultAttributesOptions) GetRef() string { return *c.Ref } +// GetAccepted returns the Accepted field. +func (c *CodespacePermissions) GetAccepted() bool { + if c == nil { + return false + } + return c.Accepted +} + +// GetPullRequestNumber returns the PullRequestNumber field. +func (c *CodespacePullRequestOptions) GetPullRequestNumber() int64 { + if c == nil { + return 0 + } + return c.PullRequestNumber +} + +// GetRepositoryID returns the RepositoryID field. +func (c *CodespacePullRequestOptions) GetRepositoryID() int64 { + if c == nil { + return 0 + } + return c.RepositoryID +} + // GetAhead returns the Ahead field if it's non-nil, zero value otherwise. func (c *CodespacesGitStatus) GetAhead() int { if c == nil || c.Ahead == nil { @@ -4062,6 +5830,46 @@ func (c *CodespacesMachine) GetStorageInBytes() int64 { return *c.StorageInBytes } +// GetMachines returns the Machines slice if it's non-nil, nil otherwise. +func (c *CodespacesMachines) GetMachines() []*CodespacesMachine { + if c == nil || c.Machines == nil { + return nil + } + return c.Machines +} + +// GetTotalCount returns the TotalCount field. +func (c *CodespacesMachines) GetTotalCount() int64 { + if c == nil { + return 0 + } + return c.TotalCount +} + +// GetSelectedUsernames returns the SelectedUsernames slice if it's non-nil, nil otherwise. +func (c *CodespacesOrgAccessControlRequest) GetSelectedUsernames() []string { + if c == nil || c.SelectedUsernames == nil { + return nil + } + return c.SelectedUsernames +} + +// GetVisibility returns the Visibility field. +func (c *CodespacesOrgAccessControlRequest) GetVisibility() string { + if c == nil { + return "" + } + return c.Visibility +} + +// GetAllowedPortPrivacySettings returns the AllowedPortPrivacySettings slice if it's non-nil, nil otherwise. +func (c *CodespacesRuntimeConstraints) GetAllowedPortPrivacySettings() []string { + if c == nil || c.AllowedPortPrivacySettings == nil { + return nil + } + return c.AllowedPortPrivacySettings +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (c *CollaboratorInvitation) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { @@ -4166,6 +5974,14 @@ func (c *CombinedStatus) GetState() string { return *c.State } +// GetStatuses returns the Statuses slice if it's non-nil, nil otherwise. +func (c *CombinedStatus) GetStatuses() []*RepoStatus { + if c == nil || c.Statuses == nil { + return nil + } + return c.Statuses +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (c *CombinedStatus) GetTotalCount() int { if c == nil || c.TotalCount == nil { @@ -4174,6 +5990,14 @@ func (c *CombinedStatus) GetTotalCount() int { return *c.TotalCount } +// GetBody returns the Body field. +func (c *Comment) GetBody() string { + if c == nil { + return "" + } + return c.Body +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (c *Comment) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { @@ -4366,6 +6190,14 @@ func (c *Commit) GetNodeID() string { return *c.NodeID } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (c *Commit) GetParents() []*Commit { + if c == nil || c.Parents == nil { + return nil + } + return c.Parents +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (c *Commit) GetSHA() string { if c == nil || c.SHA == nil { @@ -4606,6 +6438,14 @@ func (c *CommitResult) GetHTMLURL() string { return *c.HTMLURL } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (c *CommitResult) GetParents() []*Commit { + if c == nil || c.Parents == nil { + return nil + } + return c.Parents +} + // GetRepository returns the Repository field. func (c *CommitResult) GetRepository() *Repository { if c == nil { @@ -4614,12 +6454,12 @@ func (c *CommitResult) GetRepository() *Repository { return c.Repository } -// GetScore returns the Score field. -func (c *CommitResult) GetScore() *float64 { - if c == nil { - return nil +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (c *CommitResult) GetScore() float64 { + if c == nil || c.Score == nil { + return 0 } - return c.Score + return *c.Score } // GetSHA returns the SHA field if it's non-nil, zero value otherwise. @@ -4662,6 +6502,14 @@ func (c *CommitsComparison) GetBehindBy() int { return *c.BehindBy } +// GetCommits returns the Commits slice if it's non-nil, nil otherwise. +func (c *CommitsComparison) GetCommits() []*RepositoryCommit { + if c == nil || c.Commits == nil { + return nil + } + return c.Commits +} + // GetDiffURL returns the DiffURL field if it's non-nil, zero value otherwise. func (c *CommitsComparison) GetDiffURL() string { if c == nil || c.DiffURL == nil { @@ -4670,6 +6518,14 @@ func (c *CommitsComparison) GetDiffURL() string { return *c.DiffURL } +// GetFiles returns the Files slice if it's non-nil, nil otherwise. +func (c *CommitsComparison) GetFiles() []*CommitFile { + if c == nil || c.Files == nil { + return nil + } + return c.Files +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (c *CommitsComparison) GetHTMLURL() string { if c == nil || c.HTMLURL == nil { @@ -4726,6 +6582,54 @@ func (c *CommitsComparison) GetURL() string { return *c.URL } +// GetAuthor returns the Author field. +func (c *CommitsListOptions) GetAuthor() string { + if c == nil { + return "" + } + return c.Author +} + +// GetPath returns the Path field. +func (c *CommitsListOptions) GetPath() string { + if c == nil { + return "" + } + return c.Path +} + +// GetSHA returns the SHA field. +func (c *CommitsListOptions) GetSHA() string { + if c == nil { + return "" + } + return c.SHA +} + +// GetSince returns the Since field. +func (c *CommitsListOptions) GetSince() time.Time { + if c == nil { + return time.Time{} + } + return c.Since +} + +// GetUntil returns the Until field. +func (c *CommitsListOptions) GetUntil() time.Time { + if c == nil { + return time.Time{} + } + return c.Until +} + +// GetCommits returns the Commits slice if it's non-nil, nil otherwise. +func (c *CommitsSearchResult) GetCommits() []*CommitResult { + if c == nil || c.Commits == nil { + return nil + } + return c.Commits +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (c *CommitsSearchResult) GetIncompleteResults() bool { if c == nil || c.IncompleteResults == nil { @@ -4870,6 +6774,22 @@ func (c *CommunityHealthMetrics) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (c *ConfigApplyEvents) GetNodes() []*ConfigApplyEventsNode { + if c == nil || c.Nodes == nil { + return nil + } + return c.Nodes +} + +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (c *ConfigApplyEventsNode) GetEvents() []*ConfigApplyEventsNodeEvent { + if c == nil || c.Events == nil { + return nil + } + return c.Events +} + // GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise. func (c *ConfigApplyEventsNode) GetLastRequestID() string { if c == nil || c.LastRequestID == nil { @@ -4990,6 +6910,14 @@ func (c *ConfigApplyOptions) GetRunID() string { return *c.RunID } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (c *ConfigApplyStatus) GetNodes() []*ConfigApplyStatusNode { + if c == nil || c.Nodes == nil { + return nil + } + return c.Nodes +} + // GetRunning returns the Running field if it's non-nil, zero value otherwise. func (c *ConfigApplyStatus) GetRunning() bool { if c == nil || c.Running == nil { @@ -5454,6 +7382,14 @@ func (c *ConfigSettingsLDAP) GetAdminGroup() string { return *c.AdminGroup } +// GetBase returns the Base slice if it's non-nil, nil otherwise. +func (c *ConfigSettingsLDAP) GetBase() []string { + if c == nil || c.Base == nil { + return nil + } + return c.Base +} + // GetBindDN returns the BindDN field if it's non-nil, zero value otherwise. func (c *ConfigSettingsLDAP) GetBindDN() string { if c == nil || c.BindDN == nil { @@ -5558,6 +7494,14 @@ func (c *ConfigSettingsLDAP) GetUID() string { return *c.UID } +// GetUserGroups returns the UserGroups slice if it's non-nil, nil otherwise. +func (c *ConfigSettingsLDAP) GetUserGroups() []string { + if c == nil || c.UserGroups == nil { + return nil + } + return c.UserGroups +} + // GetUserSyncEmails returns the UserSyncEmails field if it's non-nil, zero value otherwise. func (c *ConfigSettingsLDAP) GetUserSyncEmails() bool { if c == nil || c.UserSyncEmails == nil { @@ -6198,6 +8142,14 @@ func (c *Contributor) GetURL() string { return *c.URL } +// GetApprovalPolicy returns the ApprovalPolicy field. +func (c *ContributorApprovalPermissions) GetApprovalPolicy() string { + if c == nil { + return "" + } + return c.ApprovalPolicy +} + // GetAuthor returns the Author field. func (c *ContributorStats) GetAuthor() *Contributor { if c == nil { @@ -6214,6 +8166,70 @@ func (c *ContributorStats) GetTotal() int { return *c.Total } +// GetWeeks returns the Weeks slice if it's non-nil, nil otherwise. +func (c *ContributorStats) GetWeeks() []*WeeklyStats { + if c == nil || c.Weeks == nil { + return nil + } + return c.Weeks +} + +// GetParameters returns the Parameters field. +func (c *CopilotCodeReviewBranchRule) GetParameters() CopilotCodeReviewRuleParameters { + if c == nil { + return CopilotCodeReviewRuleParameters{} + } + return c.Parameters +} + +// GetReviewDraftPullRequests returns the ReviewDraftPullRequests field. +func (c *CopilotCodeReviewRuleParameters) GetReviewDraftPullRequests() bool { + if c == nil { + return false + } + return c.ReviewDraftPullRequests +} + +// GetReviewOnPush returns the ReviewOnPush field. +func (c *CopilotCodeReviewRuleParameters) GetReviewOnPush() bool { + if c == nil { + return false + } + return c.ReviewOnPush +} + +// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetricsReport) GetDownloadLinks() []string { + if c == nil || c.DownloadLinks == nil { + return nil + } + return c.DownloadLinks +} + +// GetReportDay returns the ReportDay field. +func (c *CopilotDailyMetricsReport) GetReportDay() string { + if c == nil { + return "" + } + return c.ReportDay +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotDotcomChat) GetModels() []*CopilotDotcomChatModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomChat) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6222,6 +8238,54 @@ func (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotDotcomChatModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetName returns the Name field. +func (c *CopilotDotcomChatModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalChats returns the TotalChats field. +func (c *CopilotDotcomChatModel) GetTotalChats() int { + if c == nil { + return 0 + } + return c.TotalChats +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomChatModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (c *CopilotDotcomPullRequests) GetRepositories() []*CopilotDotcomPullRequestsRepository { + if c == nil || c.Repositories == nil { + return nil + } + return c.Repositories +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomPullRequests) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6230,6 +8294,102 @@ func (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotDotcomPullRequestsModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetName returns the Name field. +func (c *CopilotDotcomPullRequestsModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomPullRequestsModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetTotalPRSummariesCreated returns the TotalPRSummariesCreated field. +func (c *CopilotDotcomPullRequestsModel) GetTotalPRSummariesCreated() int { + if c == nil { + return 0 + } + return c.TotalPRSummariesCreated +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotDotcomPullRequestsRepository) GetModels() []*CopilotDotcomPullRequestsModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetName returns the Name field. +func (c *CopilotDotcomPullRequestsRepository) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomPullRequestsRepository) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetEditors returns the Editors slice if it's non-nil, nil otherwise. +func (c *CopilotIDEChat) GetEditors() []*CopilotIDEChatEditor { + if c == nil || c.Editors == nil { + return nil + } + return c.Editors +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDEChat) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotIDEChatEditor) GetModels() []*CopilotIDEChatModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetName returns the Name field. +func (c *CopilotIDEChatEditor) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDEChatEditor) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6238,6 +8398,118 @@ func (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotIDEChatModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetName returns the Name field. +func (c *CopilotIDEChatModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalChatCopyEvents returns the TotalChatCopyEvents field. +func (c *CopilotIDEChatModel) GetTotalChatCopyEvents() int { + if c == nil { + return 0 + } + return c.TotalChatCopyEvents +} + +// GetTotalChatInsertionEvents returns the TotalChatInsertionEvents field. +func (c *CopilotIDEChatModel) GetTotalChatInsertionEvents() int { + if c == nil { + return 0 + } + return c.TotalChatInsertionEvents +} + +// GetTotalChats returns the TotalChats field. +func (c *CopilotIDEChatModel) GetTotalChats() int { + if c == nil { + return 0 + } + return c.TotalChats +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDEChatModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetEditors returns the Editors slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletions) GetEditors() []*CopilotIDECodeCompletionsEditor { + if c == nil || c.Editors == nil { + return nil + } + return c.Editors +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletions) GetLanguages() []*CopilotIDECodeCompletionsLanguage { + if c == nil || c.Languages == nil { + return nil + } + return c.Languages +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletions) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletionsEditor) GetModels() []*CopilotIDECodeCompletionsModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsEditor) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsEditor) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsLanguage) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsLanguage) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6246,6 +8518,86 @@ func (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotIDECodeCompletionsModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletionsModel) GetLanguages() []*CopilotIDECodeCompletionsModelLanguage { + if c == nil || c.Languages == nil { + return nil + } + return c.Languages +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalCodeAcceptances returns the TotalCodeAcceptances field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeAcceptances() int { + if c == nil { + return 0 + } + return c.TotalCodeAcceptances +} + +// GetTotalCodeLinesAccepted returns the TotalCodeLinesAccepted field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeLinesAccepted() int { + if c == nil { + return 0 + } + return c.TotalCodeLinesAccepted +} + +// GetTotalCodeLinesSuggested returns the TotalCodeLinesSuggested field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeLinesSuggested() int { + if c == nil { + return 0 + } + return c.TotalCodeLinesSuggested +} + +// GetTotalCodeSuggestions returns the TotalCodeSuggestions field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeSuggestions() int { + if c == nil { + return 0 + } + return c.TotalCodeSuggestions +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCopilotDotcomChat returns the CopilotDotcomChat field. func (c *CopilotMetrics) GetCopilotDotcomChat() *CopilotDotcomChat { if c == nil { @@ -6278,6 +8630,14 @@ func (c *CopilotMetrics) GetCopilotIDECodeCompletions() *CopilotIDECodeCompletio return c.CopilotIDECodeCompletions } +// GetDate returns the Date field. +func (c *CopilotMetrics) GetDate() string { + if c == nil { + return "" + } + return c.Date +} + // GetTotalActiveUsers returns the TotalActiveUsers field if it's non-nil, zero value otherwise. func (c *CopilotMetrics) GetTotalActiveUsers() int { if c == nil || c.TotalActiveUsers == nil { @@ -6310,6 +8670,54 @@ func (c *CopilotMetricsListOptions) GetUntil() time.Time { return *c.Until } +// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise. +func (c *CopilotMetricsReport) GetDownloadLinks() []string { + if c == nil || c.DownloadLinks == nil { + return nil + } + return c.DownloadLinks +} + +// GetReportEndDay returns the ReportEndDay field. +func (c *CopilotMetricsReport) GetReportEndDay() string { + if c == nil { + return "" + } + return c.ReportEndDay +} + +// GetReportStartDay returns the ReportStartDay field. +func (c *CopilotMetricsReport) GetReportStartDay() string { + if c == nil { + return "" + } + return c.ReportStartDay +} + +// GetDay returns the Day field. +func (c *CopilotMetricsReportOptions) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetCopilotChat returns the CopilotChat field. +func (c *CopilotOrganizationDetails) GetCopilotChat() string { + if c == nil { + return "" + } + return c.CopilotChat +} + +// GetPublicCodeSuggestions returns the PublicCodeSuggestions field. +func (c *CopilotOrganizationDetails) GetPublicCodeSuggestions() string { + if c == nil { + return "" + } + return c.PublicCodeSuggestions +} + // GetSeatBreakdown returns the SeatBreakdown field. func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { if c == nil { @@ -6318,6 +8726,70 @@ func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { return c.SeatBreakdown } +// GetSeatManagementSetting returns the SeatManagementSetting field. +func (c *CopilotOrganizationDetails) GetSeatManagementSetting() string { + if c == nil { + return "" + } + return c.SeatManagementSetting +} + +// GetActiveThisCycle returns the ActiveThisCycle field. +func (c *CopilotSeatBreakdown) GetActiveThisCycle() int { + if c == nil { + return 0 + } + return c.ActiveThisCycle +} + +// GetAddedThisCycle returns the AddedThisCycle field. +func (c *CopilotSeatBreakdown) GetAddedThisCycle() int { + if c == nil { + return 0 + } + return c.AddedThisCycle +} + +// GetInactiveThisCycle returns the InactiveThisCycle field. +func (c *CopilotSeatBreakdown) GetInactiveThisCycle() int { + if c == nil { + return 0 + } + return c.InactiveThisCycle +} + +// GetPendingCancellation returns the PendingCancellation field. +func (c *CopilotSeatBreakdown) GetPendingCancellation() int { + if c == nil { + return 0 + } + return c.PendingCancellation +} + +// GetPendingInvitation returns the PendingInvitation field. +func (c *CopilotSeatBreakdown) GetPendingInvitation() int { + if c == nil { + return 0 + } + return c.PendingInvitation +} + +// GetTotal returns the Total field. +func (c *CopilotSeatBreakdown) GetTotal() int { + if c == nil { + return 0 + } + return c.Total +} + +// GetAssignee returns the Assignee field. +func (c *CopilotSeatDetails) GetAssignee() any { + if c == nil { + return nil + } + return c.Assignee +} + // GetAssigningTeam returns the AssigningTeam field. func (c *CopilotSeatDetails) GetAssigningTeam() *Team { if c == nil { @@ -6382,6 +8854,30 @@ func (c *CostCenter) GetAzureSubscription() string { return *c.AzureSubscription } +// GetID returns the ID field. +func (c *CostCenter) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// GetName returns the Name field. +func (c *CostCenter) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (c *CostCenter) GetResources() []*CostCenterResource { + if c == nil || c.Resources == nil { + return nil + } + return c.Resources +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (c *CostCenter) GetState() string { if c == nil || c.State == nil { @@ -6390,6 +8886,230 @@ func (c *CostCenter) GetState() string { return *c.State } +// GetName returns the Name field. +func (c *CostCenterRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetName returns the Name field. +func (c *CostCenterResource) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetType returns the Type field. +func (c *CostCenterResource) GetType() string { + if c == nil { + return "" + } + return c.Type +} + +// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise. +func (c *CostCenterResourceRequest) GetOrganizations() []string { + if c == nil || c.Organizations == nil { + return nil + } + return c.Organizations +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (c *CostCenterResourceRequest) GetRepositories() []string { + if c == nil || c.Repositories == nil { + return nil + } + return c.Repositories +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (c *CostCenterResourceRequest) GetUsers() []string { + if c == nil || c.Users == nil { + return nil + } + return c.Users +} + +// GetCostCenters returns the CostCenters slice if it's non-nil, nil otherwise. +func (c *CostCenters) GetCostCenters() []*CostCenter { + if c == nil || c.CostCenters == nil { + return nil + } + return c.CostCenters +} + +// GetCluster returns the Cluster field if it's non-nil, zero value otherwise. +func (c *CreateArtifactDeploymentRequest) GetCluster() string { + if c == nil || c.Cluster == nil { + return "" + } + return *c.Cluster +} + +// GetDeploymentName returns the DeploymentName field. +func (c *CreateArtifactDeploymentRequest) GetDeploymentName() string { + if c == nil { + return "" + } + return c.DeploymentName +} + +// GetDigest returns the Digest field. +func (c *CreateArtifactDeploymentRequest) GetDigest() string { + if c == nil { + return "" + } + return c.Digest +} + +// GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise. +func (c *CreateArtifactDeploymentRequest) GetGithubRepository() string { + if c == nil || c.GithubRepository == nil { + return "" + } + return *c.GithubRepository +} + +// GetLogicalEnvironment returns the LogicalEnvironment field. +func (c *CreateArtifactDeploymentRequest) GetLogicalEnvironment() string { + if c == nil { + return "" + } + return c.LogicalEnvironment +} + +// GetName returns the Name field. +func (c *CreateArtifactDeploymentRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise. +func (c *CreateArtifactDeploymentRequest) GetPhysicalEnvironment() string { + if c == nil || c.PhysicalEnvironment == nil { + return "" + } + return *c.PhysicalEnvironment +} + +// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise. +func (c *CreateArtifactDeploymentRequest) GetRuntimeRisks() []DeploymentRuntimeRisk { + if c == nil || c.RuntimeRisks == nil { + return nil + } + return c.RuntimeRisks +} + +// GetStatus returns the Status field. +func (c *CreateArtifactDeploymentRequest) GetStatus() string { + if c == nil { + return "" + } + return c.Status +} + +// GetTags returns the Tags map if it's non-nil, an empty map otherwise. +func (c *CreateArtifactDeploymentRequest) GetTags() map[string]string { + if c == nil || c.Tags == nil { + return map[string]string{} + } + return c.Tags +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (c *CreateArtifactDeploymentRequest) GetVersion() string { + if c == nil || c.Version == nil { + return "" + } + return *c.Version +} + +// GetArtifactURL returns the ArtifactURL field if it's non-nil, zero value otherwise. +func (c *CreateArtifactStorageRequest) GetArtifactURL() string { + if c == nil || c.ArtifactURL == nil { + return "" + } + return *c.ArtifactURL +} + +// GetDigest returns the Digest field. +func (c *CreateArtifactStorageRequest) GetDigest() string { + if c == nil { + return "" + } + return c.Digest +} + +// GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise. +func (c *CreateArtifactStorageRequest) GetGithubRepository() string { + if c == nil || c.GithubRepository == nil { + return "" + } + return *c.GithubRepository +} + +// GetName returns the Name field. +func (c *CreateArtifactStorageRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (c *CreateArtifactStorageRequest) GetPath() string { + if c == nil || c.Path == nil { + return "" + } + return *c.Path +} + +// GetRegistryURL returns the RegistryURL field. +func (c *CreateArtifactStorageRequest) GetRegistryURL() string { + if c == nil { + return "" + } + return c.RegistryURL +} + +// GetRepository returns the Repository field if it's non-nil, zero value otherwise. +func (c *CreateArtifactStorageRequest) GetRepository() string { + if c == nil || c.Repository == nil { + return "" + } + return *c.Repository +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *CreateArtifactStorageRequest) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (c *CreateArtifactStorageRequest) GetVersion() string { + if c == nil || c.Version == nil { + return "" + } + return *c.Version +} + +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (c *CreateCheckRunOptions) GetActions() []*CheckRunAction { + if c == nil || c.Actions == nil { + return nil + } + return c.Actions +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { @@ -6422,6 +9142,22 @@ func (c *CreateCheckRunOptions) GetExternalID() string { return *c.ExternalID } +// GetHeadSHA returns the HeadSHA field. +func (c *CreateCheckRunOptions) GetHeadSHA() string { + if c == nil { + return "" + } + return c.HeadSHA +} + +// GetName returns the Name field. +func (c *CreateCheckRunOptions) GetName() string { + if c == nil { + return "" + } + return c.Name +} + // GetOutput returns the Output field. func (c *CreateCheckRunOptions) GetOutput() *CheckRunOutput { if c == nil { @@ -6454,6 +9190,14 @@ func (c *CreateCheckSuiteOptions) GetHeadBranch() string { return *c.HeadBranch } +// GetHeadSHA returns the HeadSHA field. +func (c *CreateCheckSuiteOptions) GetHeadSHA() string { + if c == nil { + return "" + } + return c.HeadSHA +} + // GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. func (c *CreateCodespaceOptions) GetClientIP() string { if c == nil || c.ClientIP == nil { @@ -6542,6 +9286,46 @@ func (c *CreateCodespaceOptions) GetWorkingDirectory() string { return *c.WorkingDirectory } +// GetSigner returns the Signer field. +func (c *CreateCommitOptions) GetSigner() MessageSigner { + if c == nil { + return nil + } + return c.Signer +} + +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateCustomOrgRoleRequest) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateCustomOrgRoleRequest) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetName returns the Name field. +func (c *CreateCustomOrgRoleRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CreateCustomOrgRoleRequest) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (c *CreateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool { if c == nil || c.AllowsPublicRepositories == nil { @@ -6558,6 +9342,14 @@ func (c *CreateEnterpriseRunnerGroupRequest) GetName() string { return *c.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetNetworkConfigurationID() string { + if c == nil || c.NetworkConfigurationID == nil { + return "" + } + return *c.NetworkConfigurationID +} + // GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. func (c *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { if c == nil || c.RestrictedToWorkflows == nil { @@ -6566,6 +9358,30 @@ func (c *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *c.RestrictedToWorkflows } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetRunners() []int64 { + if c == nil || c.Runners == nil { + return nil + } + return c.Runners +} + +// GetSelectedOrganizationIDs returns the SelectedOrganizationIDs slice if it's non-nil, nil otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetSelectedOrganizationIDs() []int64 { + if c == nil || c.SelectedOrganizationIDs == nil { + return nil + } + return c.SelectedOrganizationIDs +} + +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetSelectedWorkflows() []string { + if c == nil || c.SelectedWorkflows == nil { + return nil + } + return c.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (c *CreateEnterpriseRunnerGroupRequest) GetVisibility() string { if c == nil || c.Visibility == nil { @@ -6646,6 +9462,102 @@ func (c *CreateEvent) GetSender() *User { return c.Sender } +// GetEnableStaticIP returns the EnableStaticIP field if it's non-nil, zero value otherwise. +func (c *CreateHostedRunnerRequest) GetEnableStaticIP() bool { + if c == nil || c.EnableStaticIP == nil { + return false + } + return *c.EnableStaticIP +} + +// GetImage returns the Image field. +func (c *CreateHostedRunnerRequest) GetImage() HostedRunnerImage { + if c == nil { + return HostedRunnerImage{} + } + return c.Image +} + +// GetImageGen returns the ImageGen field if it's non-nil, zero value otherwise. +func (c *CreateHostedRunnerRequest) GetImageGen() bool { + if c == nil || c.ImageGen == nil { + return false + } + return *c.ImageGen +} + +// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise. +func (c *CreateHostedRunnerRequest) GetMaximumRunners() int64 { + if c == nil || c.MaximumRunners == nil { + return 0 + } + return *c.MaximumRunners +} + +// GetName returns the Name field. +func (c *CreateHostedRunnerRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetRunnerGroupID returns the RunnerGroupID field. +func (c *CreateHostedRunnerRequest) GetRunnerGroupID() int64 { + if c == nil { + return 0 + } + return c.RunnerGroupID +} + +// GetSize returns the Size field. +func (c *CreateHostedRunnerRequest) GetSize() string { + if c == nil { + return "" + } + return c.Size +} + +// GetEncryptedValue returns the EncryptedValue field. +func (c *CreateOrganizationPrivateRegistry) GetEncryptedValue() string { + if c == nil { + return "" + } + return c.EncryptedValue +} + +// GetKeyID returns the KeyID field. +func (c *CreateOrganizationPrivateRegistry) GetKeyID() string { + if c == nil { + return "" + } + return c.KeyID +} + +// GetRegistryType returns the RegistryType field. +func (c *CreateOrganizationPrivateRegistry) GetRegistryType() string { + if c == nil { + return "" + } + return c.RegistryType +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (c *CreateOrganizationPrivateRegistry) GetSelectedRepositoryIDs() []int64 { + if c == nil || c.SelectedRepositoryIDs == nil { + return nil + } + return c.SelectedRepositoryIDs +} + +// GetURL returns the URL field. +func (c *CreateOrganizationPrivateRegistry) GetURL() string { + if c == nil { + return "" + } + return c.URL +} + // GetUsername returns the Username field if it's non-nil, zero value otherwise. func (c *CreateOrganizationPrivateRegistry) GetUsername() string { if c == nil || c.Username == nil { @@ -6654,6 +9566,14 @@ func (c *CreateOrganizationPrivateRegistry) GetUsername() string { return *c.Username } +// GetVisibility returns the Visibility field. +func (c *CreateOrganizationPrivateRegistry) GetVisibility() PrivateRegistryVisibility { + if c == nil { + return "" + } + return c.Visibility +} + // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (c *CreateOrgInvitationOptions) GetEmail() string { if c == nil || c.Email == nil { @@ -6678,6 +9598,14 @@ func (c *CreateOrgInvitationOptions) GetRole() string { return *c.Role } +// GetTeamID returns the TeamID slice if it's non-nil, nil otherwise. +func (c *CreateOrgInvitationOptions) GetTeamID() []int64 { + if c == nil || c.TeamID == nil { + return nil + } + return c.TeamID +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateCustomRepoRoleOptions) GetBaseRole() string { if c == nil || c.BaseRole == nil { @@ -6702,6 +9630,14 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { return *c.Name } +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CreateOrUpdateCustomRepoRoleOptions) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetColor returns the Color field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateIssueTypesOptions) GetColor() string { if c == nil || c.Color == nil { @@ -6718,6 +9654,14 @@ func (c *CreateOrUpdateIssueTypesOptions) GetDescription() string { return *c.Description } +// GetIsEnabled returns the IsEnabled field. +func (c *CreateOrUpdateIssueTypesOptions) GetIsEnabled() bool { + if c == nil { + return false + } + return c.IsEnabled +} + // GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool { if c == nil || c.IsPrivate == nil { @@ -6726,36 +9670,36 @@ func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool { return *c.IsPrivate } -// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { - if c == nil || c.BaseRole == nil { +// GetName returns the Name field. +func (c *CreateOrUpdateIssueTypesOptions) GetName() string { + if c == nil { return "" } - return *c.BaseRole + return c.Name } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { - if c == nil || c.Description == nil { - return "" +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (c *CreateProtectedChanges) GetFrom() bool { + if c == nil || c.From == nil { + return false } - return *c.Description + return *c.From } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetName() string { - if c == nil || c.Name == nil { +// GetRef returns the Ref field. +func (c *CreateRef) GetRef() string { + if c == nil { return "" } - return *c.Name + return c.Ref } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (c *CreateProtectedChanges) GetFrom() bool { - if c == nil || c.From == nil { - return false +// GetSHA returns the SHA field. +func (c *CreateRef) GetSHA() string { + if c == nil { + return "" } - return *c.From + return c.SHA } // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. @@ -6790,6 +9734,30 @@ func (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *c.RestrictedToWorkflows } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (c *CreateRunnerGroupRequest) GetRunners() []int64 { + if c == nil || c.Runners == nil { + return nil + } + return c.Runners +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (c *CreateRunnerGroupRequest) GetSelectedRepositoryIDs() []int64 { + if c == nil || c.SelectedRepositoryIDs == nil { + return nil + } + return c.SelectedRepositoryIDs +} + +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (c *CreateRunnerGroupRequest) GetSelectedWorkflows() []string { + if c == nil || c.SelectedWorkflows == nil { + return nil + } + return c.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (c *CreateRunnerGroupRequest) GetVisibility() string { if c == nil || c.Visibility == nil { @@ -6798,6 +9766,30 @@ func (c *CreateRunnerGroupRequest) GetVisibility() string { return *c.Visibility } +// GetMessage returns the Message field. +func (c *CreateTag) GetMessage() string { + if c == nil { + return "" + } + return c.Message +} + +// GetObject returns the Object field. +func (c *CreateTag) GetObject() string { + if c == nil { + return "" + } + return c.Object +} + +// GetTag returns the Tag field. +func (c *CreateTag) GetTag() string { + if c == nil { + return "" + } + return c.Tag +} + // GetTagger returns the Tagger field. func (c *CreateTag) GetTagger() *CommitAuthor { if c == nil { @@ -6806,6 +9798,14 @@ func (c *CreateTag) GetTagger() *CommitAuthor { return c.Tagger } +// GetType returns the Type field. +func (c *CreateTag) GetType() string { + if c == nil { + return "" + } + return c.Type +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (c *CreateUpdateEnvironment) GetCanAdminsBypass() bool { if c == nil || c.CanAdminsBypass == nil { @@ -6830,6 +9830,14 @@ func (c *CreateUpdateEnvironment) GetPreventSelfReview() bool { return *c.PreventSelfReview } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (c *CreateUpdateEnvironment) GetReviewers() []*EnvReviewers { + if c == nil || c.Reviewers == nil { + return nil + } + return c.Reviewers +} + // GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. func (c *CreateUpdateEnvironment) GetWaitTimer() int { if c == nil || c.WaitTimer == nil { @@ -6846,6 +9854,14 @@ func (c *CreateUserRequest) GetEmail() string { return *c.Email } +// GetLogin returns the Login field. +func (c *CreateUserRequest) GetLogin() string { + if c == nil { + return "" + } + return c.Login +} + // GetSuspended returns the Suspended field if it's non-nil, zero value otherwise. func (c *CreateUserRequest) GetSuspended() bool { if c == nil || c.Suspended == nil { @@ -6862,6 +9878,22 @@ func (c *CreateWorkflowDispatchEventRequest) GetInputs() map[string]any { return c.Inputs } +// GetRef returns the Ref field. +func (c *CreateWorkflowDispatchEventRequest) GetRef() string { + if c == nil { + return "" + } + return c.Ref +} + +// GetReturnRunDetails returns the ReturnRunDetails field if it's non-nil, zero value otherwise. +func (c *CreateWorkflowDispatchEventRequest) GetReturnRunDetails() bool { + if c == nil || c.ReturnRunDetails == nil { + return false + } + return *c.ReturnRunDetails +} + // GetCreated returns the Created field if it's non-nil, zero value otherwise. func (c *CreationInfo) GetCreated() Timestamp { if c == nil || c.Created == nil { @@ -6870,6 +9902,14 @@ func (c *CreationInfo) GetCreated() Timestamp { return *c.Created } +// GetCreators returns the Creators slice if it's non-nil, nil otherwise. +func (c *CreationInfo) GetCreators() []string { + if c == nil || c.Creators == nil { + return nil + } + return c.Creators +} + // GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise. func (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp { if c == nil || c.AuthorizedCredentialExpiresAt == nil { @@ -6950,6 +9990,14 @@ func (c *CredentialAuthorization) GetLogin() string { return *c.Login } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (c *CredentialAuthorization) GetScopes() []string { + if c == nil || c.Scopes == nil { + return nil + } + return c.Scopes +} + // GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise. func (c *CredentialAuthorization) GetTokenLastEight() string { if c == nil || c.TokenLastEight == nil { @@ -6958,6 +10006,14 @@ func (c *CredentialAuthorization) GetTokenLastEight() string { return *c.TokenLastEight } +// GetLogin returns the Login field. +func (c *CredentialAuthorizationsListOptions) GetLogin() string { + if c == nil { + return "" + } + return c.Login +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (c *Credit) GetType() string { if c == nil || c.Type == nil { @@ -7047,7 +10103,7 @@ func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { } // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetBaseRole() string { +func (c *CustomOrgRole) GetBaseRole() string { if c == nil || c.BaseRole == nil { return "" } @@ -7055,7 +10111,7 @@ func (c *CustomOrgRoles) GetBaseRole() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetCreatedAt() Timestamp { +func (c *CustomOrgRole) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { return Timestamp{} } @@ -7063,7 +10119,7 @@ func (c *CustomOrgRoles) GetCreatedAt() Timestamp { } // GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetDescription() string { +func (c *CustomOrgRole) GetDescription() string { if c == nil || c.Description == nil { return "" } @@ -7071,7 +10127,7 @@ func (c *CustomOrgRoles) GetDescription() string { } // GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetID() int64 { +func (c *CustomOrgRole) GetID() int64 { if c == nil || c.ID == nil { return 0 } @@ -7079,7 +10135,7 @@ func (c *CustomOrgRoles) GetID() int64 { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetName() string { +func (c *CustomOrgRole) GetName() string { if c == nil || c.Name == nil { return "" } @@ -7087,15 +10143,23 @@ func (c *CustomOrgRoles) GetName() string { } // GetOrg returns the Org field. -func (c *CustomOrgRoles) GetOrg() *Organization { +func (c *CustomOrgRole) GetOrg() *Organization { if c == nil { return nil } return c.Org } +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CustomOrgRole) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetSource returns the Source field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetSource() string { +func (c *CustomOrgRole) GetSource() string { if c == nil || c.Source == nil { return "" } @@ -7103,7 +10167,7 @@ func (c *CustomOrgRoles) GetSource() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetUpdatedAt() Timestamp { +func (c *CustomOrgRole) GetUpdatedAt() Timestamp { if c == nil || c.UpdatedAt == nil { return Timestamp{} } @@ -7126,6 +10190,22 @@ func (c *CustomPatternBackfillScan) GetPatternSlug() string { return *c.PatternSlug } +// GetAllowedValues returns the AllowedValues slice if it's non-nil, nil otherwise. +func (c *CustomProperty) GetAllowedValues() []string { + if c == nil || c.AllowedValues == nil { + return nil + } + return c.AllowedValues +} + +// GetDefaultValue returns the DefaultValue field. +func (c *CustomProperty) GetDefaultValue() any { + if c == nil { + return nil + } + return c.DefaultValue +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDescription() string { if c == nil || c.Description == nil { @@ -7174,6 +10254,14 @@ func (c *CustomProperty) GetValuesEditableBy() string { return *c.ValuesEditableBy } +// GetValueType returns the ValueType field. +func (c *CustomProperty) GetValueType() PropertyValueType { + if c == nil { + return "" + } + return c.ValueType +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (c *CustomPropertyEvent) GetAction() string { if c == nil || c.Action == nil { @@ -7222,6 +10310,22 @@ func (c *CustomPropertyEvent) GetSender() *User { return c.Sender } +// GetPropertyName returns the PropertyName field. +func (c *CustomPropertyValue) GetPropertyName() string { + if c == nil { + return "" + } + return c.PropertyName +} + +// GetValue returns the Value field. +func (c *CustomPropertyValue) GetValue() any { + if c == nil { + return nil + } + return c.Value +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (c *CustomPropertyValuesEvent) GetAction() string { if c == nil || c.Action == nil { @@ -7246,6 +10350,22 @@ func (c *CustomPropertyValuesEvent) GetInstallation() *Installation { return c.Installation } +// GetNewPropertyValues returns the NewPropertyValues slice if it's non-nil, nil otherwise. +func (c *CustomPropertyValuesEvent) GetNewPropertyValues() []*CustomPropertyValue { + if c == nil || c.NewPropertyValues == nil { + return nil + } + return c.NewPropertyValues +} + +// GetOldPropertyValues returns the OldPropertyValues slice if it's non-nil, nil otherwise. +func (c *CustomPropertyValuesEvent) GetOldPropertyValues() []*CustomPropertyValue { + if c == nil || c.OldPropertyValues == nil { + return nil + } + return c.OldPropertyValues +} + // GetOrg returns the Org field. func (c *CustomPropertyValuesEvent) GetOrg() *Organization { if c == nil { @@ -7318,6 +10438,14 @@ func (c *CustomRepoRoles) GetOrg() *Organization { return c.Org } +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CustomRepoRoles) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { if c == nil || c.UpdatedAt == nil { @@ -7326,6 +10454,38 @@ func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetEncryptedToken returns the EncryptedToken field. +func (d *DatadogConfig) GetEncryptedToken() string { + if d == nil { + return "" + } + return d.EncryptedToken +} + +// GetKeyID returns the KeyID field. +func (d *DatadogConfig) GetKeyID() string { + if d == nil { + return "" + } + return d.KeyID +} + +// GetSite returns the Site field. +func (d *DatadogConfig) GetSite() string { + if d == nil { + return "" + } + return d.Site +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (d *DefaultSetupConfiguration) GetLanguages() []string { + if d == nil || d.Languages == nil { + return nil + } + return d.Languages +} + // GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. func (d *DefaultSetupConfiguration) GetQuerySuite() string { if d == nil || d.QuerySuite == nil { @@ -7414,6 +10574,38 @@ func (d *DeleteAnalysis) GetNextAnalysisURL() string { return *d.NextAnalysisURL } +// GetCostCenterState returns the CostCenterState field. +func (d *DeleteCostCenterResponse) GetCostCenterState() string { + if d == nil { + return "" + } + return d.CostCenterState +} + +// GetID returns the ID field. +func (d *DeleteCostCenterResponse) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +// GetMessage returns the Message field. +func (d *DeleteCostCenterResponse) GetMessage() string { + if d == nil { + return "" + } + return d.Message +} + +// GetName returns the Name field. +func (d *DeleteCostCenterResponse) GetName() string { + if d == nil { + return "" + } + return d.Name +} + // GetInstallation returns the Installation field. func (d *DeleteEvent) GetInstallation() *Installation { if d == nil { @@ -7670,6 +10862,54 @@ func (d *DependabotAlertState) GetDismissedReason() string { return *d.DismissedReason } +// GetState returns the State field. +func (d *DependabotAlertState) GetState() string { + if d == nil { + return "" + } + return d.State +} + +// GetEncryptedValue returns the EncryptedValue field. +func (d *DependabotEncryptedSecret) GetEncryptedValue() string { + if d == nil { + return "" + } + return d.EncryptedValue +} + +// GetKeyID returns the KeyID field. +func (d *DependabotEncryptedSecret) GetKeyID() string { + if d == nil { + return "" + } + return d.KeyID +} + +// GetName returns the Name field. +func (d *DependabotEncryptedSecret) GetName() string { + if d == nil { + return "" + } + return d.Name +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. +func (d *DependabotEncryptedSecret) GetSelectedRepositoryIDs() DependabotSecretsSelectedRepoIDs { + if d == nil { + return nil + } + return d.SelectedRepositoryIDs +} + +// GetVisibility returns the Visibility field. +func (d *DependabotEncryptedSecret) GetVisibility() string { + if d == nil { + return "" + } + return d.Visibility +} + // GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetCVEID() string { if d == nil || d.CVEID == nil { @@ -7686,6 +10926,14 @@ func (d *DependabotSecurityAdvisory) GetCVSS() *AdvisoryCVSS { return d.CVSS } +// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetCWEs() []*AdvisoryCWEs { + if d == nil || d.CWEs == nil { + return nil + } + return d.CWEs +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetDescription() string { if d == nil || d.Description == nil { @@ -7710,6 +10958,14 @@ func (d *DependabotSecurityAdvisory) GetGHSAID() string { return *d.GHSAID } +// GetIdentifiers returns the Identifiers slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetIdentifiers() []*AdvisoryIdentifier { + if d == nil || d.Identifiers == nil { + return nil + } + return d.Identifiers +} + // GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp { if d == nil || d.PublishedAt == nil { @@ -7718,6 +10974,14 @@ func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp { return *d.PublishedAt } +// GetReferences returns the References slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetReferences() []*AdvisoryReference { + if d == nil || d.References == nil { + return nil + } + return d.References +} + // GetSeverity returns the Severity field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetSeverity() string { if d == nil || d.Severity == nil { @@ -7742,6 +11006,14 @@ func (d *DependabotSecurityAdvisory) GetUpdatedAt() Timestamp { return *d.UpdatedAt } +// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetVulnerabilities() []*AdvisoryVulnerability { + if d == nil || d.Vulnerabilities == nil { + return nil + } + return d.Vulnerabilities +} + // GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp { if d == nil || d.WithdrawnAt == nil { @@ -7838,6 +11110,14 @@ func (d *DependencyGraphSnapshot) GetSha() string { return *d.Sha } +// GetVersion returns the Version field. +func (d *DependencyGraphSnapshot) GetVersion() int { + if d == nil { + return 0 + } + return d.Version +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { if d == nil || d.CreatedAt == nil { @@ -7846,6 +11126,14 @@ func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { return *d.CreatedAt } +// GetID returns the ID field. +func (d *DependencyGraphSnapshotCreationData) GetID() int64 { + if d == nil { + return 0 + } + return d.ID +} + // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (d *DependencyGraphSnapshotCreationData) GetMessage() string { if d == nil || d.Message == nil { @@ -7942,6 +11230,14 @@ func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { return *d.SourceLocation } +// GetDependencies returns the Dependencies slice if it's non-nil, nil otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetDependencies() []string { + if d == nil || d.Dependencies == nil { + return nil + } + return d.Dependencies +} + // GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise. func (d *DependencyGraphSnapshotResolvedDependency) GetMetadata() map[string]any { if d == nil || d.Metadata == nil { @@ -8070,6 +11366,14 @@ func (d *Deployment) GetNodeID() string { return *d.NodeID } +// GetPayload returns the Payload field. +func (d *Deployment) GetPayload() json.RawMessage { + if d == nil { + return json.RawMessage{} + } + return d.Payload +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (d *Deployment) GetRef() string { if d == nil || d.Ref == nil { @@ -8174,6 +11478,14 @@ func (d *DeploymentBranchPolicyRequest) GetType() string { return *d.Type } +// GetBranchPolicies returns the BranchPolicies slice if it's non-nil, nil otherwise. +func (d *DeploymentBranchPolicyResponse) GetBranchPolicies() []*DeploymentBranchPolicy { + if d == nil || d.BranchPolicies == nil { + return nil + } + return d.BranchPolicies +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (d *DeploymentBranchPolicyResponse) GetTotalCount() int { if d == nil || d.TotalCount == nil { @@ -8294,6 +11606,14 @@ func (d *DeploymentProtectionRuleEvent) GetOrganization() *Organization { return d.Organization } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (d *DeploymentProtectionRuleEvent) GetPullRequests() []*PullRequest { + if d == nil || d.PullRequests == nil { + return nil + } + return d.PullRequests +} + // GetRepo returns the Repo field. func (d *DeploymentProtectionRuleEvent) GetRepo() *Repository { if d == nil { @@ -8334,6 +11654,14 @@ func (d *DeploymentRequest) GetEnvironment() string { return *d.Environment } +// GetPayload returns the Payload field. +func (d *DeploymentRequest) GetPayload() any { + if d == nil { + return nil + } + return d.Payload +} + // GetProductionEnvironment returns the ProductionEnvironment field if it's non-nil, zero value otherwise. func (d *DeploymentRequest) GetProductionEnvironment() bool { if d == nil || d.ProductionEnvironment == nil { @@ -8446,6 +11774,14 @@ func (d *DeploymentReviewEvent) GetRequester() *User { return d.Requester } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (d *DeploymentReviewEvent) GetReviewers() []*RequiredReviewer { + if d == nil || d.Reviewers == nil { + return nil + } + return d.Reviewers +} + // GetSender returns the Sender field. func (d *DeploymentReviewEvent) GetSender() *User { if d == nil { @@ -8470,6 +11806,14 @@ func (d *DeploymentReviewEvent) GetWorkflowJobRun() *WorkflowJobRun { return d.WorkflowJobRun } +// GetWorkflowJobRuns returns the WorkflowJobRuns slice if it's non-nil, nil otherwise. +func (d *DeploymentReviewEvent) GetWorkflowJobRuns() []*WorkflowJobRun { + if d == nil || d.WorkflowJobRuns == nil { + return nil + } + return d.WorkflowJobRuns +} + // GetWorkflowRun returns the WorkflowRun field. func (d *DeploymentReviewEvent) GetWorkflowRun() *WorkflowRun { if d == nil { @@ -8478,6 +11822,38 @@ func (d *DeploymentReviewEvent) GetWorkflowRun() *WorkflowRun { return d.WorkflowRun } +// GetEnvironment returns the Environment field. +func (d *DeploymentsListOptions) GetEnvironment() string { + if d == nil { + return "" + } + return d.Environment +} + +// GetRef returns the Ref field. +func (d *DeploymentsListOptions) GetRef() string { + if d == nil { + return "" + } + return d.Ref +} + +// GetSHA returns the SHA field. +func (d *DeploymentsListOptions) GetSHA() string { + if d == nil { + return "" + } + return d.SHA +} + +// GetTask returns the Task field. +func (d *DeploymentsListOptions) GetTask() string { + if d == nil { + return "" + } + return d.Task +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (d *DeploymentStatus) GetCreatedAt() Timestamp { if d == nil || d.CreatedAt == nil { @@ -8710,6 +12086,30 @@ func (d *DevContainer) GetName() string { return *d.Name } +// GetPath returns the Path field. +func (d *DevContainer) GetPath() string { + if d == nil { + return "" + } + return d.Path +} + +// GetDevcontainers returns the Devcontainers slice if it's non-nil, nil otherwise. +func (d *DevContainerConfigurations) GetDevcontainers() []*DevContainer { + if d == nil || d.Devcontainers == nil { + return nil + } + return d.Devcontainers +} + +// GetTotalCount returns the TotalCount field. +func (d *DevContainerConfigurations) GetTotalCount() int64 { + if d == nil { + return 0 + } + return d.TotalCount +} + // GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise. func (d *Discussion) GetActiveLockReason() string { if d == nil || d.ActiveLockReason == nil { @@ -9102,6 +12502,14 @@ func (d *DiscussionCommentEvent) GetSender() *User { return d.Sender } +// GetDirection returns the Direction field. +func (d *DiscussionCommentListOptions) GetDirection() string { + if d == nil { + return "" + } + return d.Direction +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DiscussionEvent) GetAction() string { if d == nil || d.Action == nil { @@ -9150,6 +12558,38 @@ func (d *DiscussionEvent) GetSender() *User { return d.Sender } +// GetDirection returns the Direction field. +func (d *DiscussionListOptions) GetDirection() string { + if d == nil { + return "" + } + return d.Direction +} + +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (d *DismissalRestrictions) GetApps() []*App { + if d == nil || d.Apps == nil { + return nil + } + return d.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (d *DismissalRestrictions) GetTeams() []*Team { + if d == nil || d.Teams == nil { + return nil + } + return d.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (d *DismissalRestrictions) GetUsers() []*User { + if d == nil || d.Users == nil { + return nil + } + return d.Users +} + // GetApps returns the Apps field if it's non-nil, zero value otherwise. func (d *DismissalRestrictionsRequest) GetApps() []string { if d == nil || d.Apps == nil { @@ -9222,6 +12662,14 @@ func (d *DispatchRequestOptions) GetClientPayload() json.RawMessage { return *d.ClientPayload } +// GetEventType returns the EventType field. +func (d *DispatchRequestOptions) GetEventType() string { + if d == nil { + return "" + } + return d.EventType +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (d *DraftReviewComment) GetBody() string { if d == nil || d.Body == nil { @@ -9406,6 +12854,54 @@ func (e *EditTitle) GetFrom() string { return *e.From } +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (e *EditTopics) GetFrom() []string { + if e == nil || e.From == nil { + return nil + } + return e.From +} + +// GetEncryptedValue returns the EncryptedValue field. +func (e *EncryptedSecret) GetEncryptedValue() string { + if e == nil { + return "" + } + return e.EncryptedValue +} + +// GetKeyID returns the KeyID field. +func (e *EncryptedSecret) GetKeyID() string { + if e == nil { + return "" + } + return e.KeyID +} + +// GetName returns the Name field. +func (e *EncryptedSecret) GetName() string { + if e == nil { + return "" + } + return e.Name +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. +func (e *EncryptedSecret) GetSelectedRepositoryIDs() SelectedRepoIDs { + if e == nil { + return nil + } + return e.SelectedRepositoryIDs +} + +// GetVisibility returns the Visibility field. +func (e *EncryptedSecret) GetVisibility() string { + if e == nil { + return "" + } + return e.Visibility +} + // GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. func (e *Enterprise) GetAvatarURL() string { if e == nil || e.AvatarURL == nil { @@ -9486,6 +12982,182 @@ func (e *Enterprise) GetWebsiteURL() string { return *e.WebsiteURL } +// GetBudgetAlerting returns the BudgetAlerting field. +func (e *EnterpriseBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting { + if e == nil { + return nil + } + return e.BudgetAlerting +} + +// GetBudgetAmount returns the BudgetAmount field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetAmount() int { + if e == nil || e.BudgetAmount == nil { + return 0 + } + return *e.BudgetAmount +} + +// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetEntityName() string { + if e == nil || e.BudgetEntityName == nil { + return "" + } + return *e.BudgetEntityName +} + +// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetProductSKU() string { + if e == nil || e.BudgetProductSKU == nil { + return "" + } + return *e.BudgetProductSKU +} + +// GetBudgetScope returns the BudgetScope field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetScope() string { + if e == nil || e.BudgetScope == nil { + return "" + } + return *e.BudgetScope +} + +// GetBudgetType returns the BudgetType field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetType() string { + if e == nil || e.BudgetType == nil { + return "" + } + return *e.BudgetType +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetID() string { + if e == nil || e.ID == nil { + return "" + } + return *e.ID +} + +// GetPreventFurtherUsage returns the PreventFurtherUsage field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetPreventFurtherUsage() bool { + if e == nil || e.PreventFurtherUsage == nil { + return false + } + return *e.PreventFurtherUsage +} + +// GetAlertRecipients returns the AlertRecipients slice if it's non-nil, nil otherwise. +func (e *EnterpriseBudgetAlerting) GetAlertRecipients() []string { + if e == nil || e.AlertRecipients == nil { + return nil + } + return e.AlertRecipients +} + +// GetWillAlert returns the WillAlert field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudgetAlerting) GetWillAlert() bool { + if e == nil || e.WillAlert == nil { + return false + } + return *e.WillAlert +} + +// GetTotalSeatsConsumed returns the TotalSeatsConsumed field. +func (e *EnterpriseConsumedLicenses) GetTotalSeatsConsumed() int { + if e == nil { + return 0 + } + return e.TotalSeatsConsumed +} + +// GetTotalSeatsPurchased returns the TotalSeatsPurchased field. +func (e *EnterpriseConsumedLicenses) GetTotalSeatsPurchased() int { + if e == nil { + return 0 + } + return e.TotalSeatsPurchased +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (e *EnterpriseConsumedLicenses) GetUsers() []*EnterpriseLicensedUsers { + if e == nil || e.Users == nil { + return nil + } + return e.Users +} + +// GetBudgetAlerting returns the BudgetAlerting field. +func (e *EnterpriseCreateBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting { + if e == nil { + return nil + } + return e.BudgetAlerting +} + +// GetBudgetAmount returns the BudgetAmount field. +func (e *EnterpriseCreateBudget) GetBudgetAmount() int { + if e == nil { + return 0 + } + return e.BudgetAmount +} + +// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise. +func (e *EnterpriseCreateBudget) GetBudgetEntityName() string { + if e == nil || e.BudgetEntityName == nil { + return "" + } + return *e.BudgetEntityName +} + +// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise. +func (e *EnterpriseCreateBudget) GetBudgetProductSKU() string { + if e == nil || e.BudgetProductSKU == nil { + return "" + } + return *e.BudgetProductSKU +} + +// GetBudgetScope returns the BudgetScope field. +func (e *EnterpriseCreateBudget) GetBudgetScope() string { + if e == nil { + return "" + } + return e.BudgetScope +} + +// GetBudgetType returns the BudgetType field. +func (e *EnterpriseCreateBudget) GetBudgetType() string { + if e == nil { + return "" + } + return e.BudgetType +} + +// GetPreventFurtherUsage returns the PreventFurtherUsage field. +func (e *EnterpriseCreateBudget) GetPreventFurtherUsage() bool { + if e == nil { + return false + } + return e.PreventFurtherUsage +} + +// GetBudget returns the Budget field. +func (e *EnterpriseCreateOrUpdateBudgetResponse) GetBudget() *EnterpriseBudget { + if e == nil { + return nil + } + return e.Budget +} + +// GetMessage returns the Message field. +func (e *EnterpriseCreateOrUpdateBudgetResponse) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + // GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. func (e *EnterpriseCustomPropertiesValues) GetOrganizationID() int64 { if e == nil || e.OrganizationID == nil { @@ -9502,6 +13174,62 @@ func (e *EnterpriseCustomPropertiesValues) GetOrganizationLogin() string { return *e.OrganizationLogin } +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertiesValues) GetProperties() []*CustomPropertyValue { + if e == nil || e.Properties == nil { + return nil + } + return e.Properties +} + +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertySchema) GetProperties() []*CustomProperty { + if e == nil || e.Properties == nil { + return nil + } + return e.Properties +} + +// GetOrganizationLogin returns the OrganizationLogin slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertyValuesRequest) GetOrganizationLogin() []string { + if e == nil || e.OrganizationLogin == nil { + return nil + } + return e.OrganizationLogin +} + +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertyValuesRequest) GetProperties() []*CustomPropertyValue { + if e == nil || e.Properties == nil { + return nil + } + return e.Properties +} + +// GetID returns the ID field. +func (e *EnterpriseDeleteBudgetResponse) GetID() string { + if e == nil { + return "" + } + return e.ID +} + +// GetMessage returns the Message field. +func (e *EnterpriseDeleteBudgetResponse) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + +// GetEnterpriseServerEmails returns the EnterpriseServerEmails slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetEnterpriseServerEmails() []string { + if e == nil || e.EnterpriseServerEmails == nil { + return nil + } + return e.EnterpriseServerEmails +} + // GetEnterpriseServerUser returns the EnterpriseServerUser field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetEnterpriseServerUser() bool { if e == nil || e.EnterpriseServerUser == nil { @@ -9510,6 +13238,38 @@ func (e *EnterpriseLicensedUsers) GetEnterpriseServerUser() bool { return *e.EnterpriseServerUser } +// GetEnterpriseServerUserIDs returns the EnterpriseServerUserIDs slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetEnterpriseServerUserIDs() []string { + if e == nil || e.EnterpriseServerUserIDs == nil { + return nil + } + return e.EnterpriseServerUserIDs +} + +// GetGithubComEnterpriseRoles returns the GithubComEnterpriseRoles slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComEnterpriseRoles() []string { + if e == nil || e.GithubComEnterpriseRoles == nil { + return nil + } + return e.GithubComEnterpriseRoles +} + +// GetGithubComLogin returns the GithubComLogin field. +func (e *EnterpriseLicensedUsers) GetGithubComLogin() string { + if e == nil { + return "" + } + return e.GithubComLogin +} + +// GetGithubComMemberRoles returns the GithubComMemberRoles slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComMemberRoles() []string { + if e == nil || e.GithubComMemberRoles == nil { + return nil + } + return e.GithubComMemberRoles +} + // GetGithubComName returns the GithubComName field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetGithubComName() string { if e == nil || e.GithubComName == nil { @@ -9518,6 +13278,14 @@ func (e *EnterpriseLicensedUsers) GetGithubComName() string { return *e.GithubComName } +// GetGithubComOrgsWithPendingInvites returns the GithubComOrgsWithPendingInvites slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComOrgsWithPendingInvites() []string { + if e == nil || e.GithubComOrgsWithPendingInvites == nil { + return nil + } + return e.GithubComOrgsWithPendingInvites +} + // GetGithubComProfile returns the GithubComProfile field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetGithubComProfile() string { if e == nil || e.GithubComProfile == nil { @@ -9542,6 +13310,38 @@ func (e *EnterpriseLicensedUsers) GetGithubComTwoFactorAuth() bool { return *e.GithubComTwoFactorAuth } +// GetGithubComUser returns the GithubComUser field. +func (e *EnterpriseLicensedUsers) GetGithubComUser() bool { + if e == nil { + return false + } + return e.GithubComUser +} + +// GetGithubComVerifiedDomainEmails returns the GithubComVerifiedDomainEmails slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComVerifiedDomainEmails() []string { + if e == nil || e.GithubComVerifiedDomainEmails == nil { + return nil + } + return e.GithubComVerifiedDomainEmails +} + +// GetLicenseType returns the LicenseType field. +func (e *EnterpriseLicensedUsers) GetLicenseType() string { + if e == nil { + return "" + } + return e.LicenseType +} + +// GetTotalUserAccounts returns the TotalUserAccounts field. +func (e *EnterpriseLicensedUsers) GetTotalUserAccounts() int { + if e == nil { + return 0 + } + return e.TotalUserAccounts +} + // GetVisualStudioLicenseStatus returns the VisualStudioLicenseStatus field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetVisualStudioLicenseStatus() string { if e == nil || e.VisualStudioLicenseStatus == nil { @@ -9558,6 +13358,22 @@ func (e *EnterpriseLicensedUsers) GetVisualStudioSubscriptionEmail() string { return *e.VisualStudioSubscriptionEmail } +// GetVisualStudioSubscriptionUser returns the VisualStudioSubscriptionUser field. +func (e *EnterpriseLicensedUsers) GetVisualStudioSubscriptionUser() bool { + if e == nil { + return false + } + return e.VisualStudioSubscriptionUser +} + +// GetDescription returns the Description field. +func (e *EnterpriseLicenseSyncStatus) GetDescription() string { + if e == nil { + return "" + } + return e.Description +} + // GetProperties returns the Properties field. func (e *EnterpriseLicenseSyncStatus) GetProperties() *ServerInstanceProperties { if e == nil { @@ -9566,6 +13382,38 @@ func (e *EnterpriseLicenseSyncStatus) GetProperties() *ServerInstanceProperties return e.Properties } +// GetTitle returns the Title field. +func (e *EnterpriseLicenseSyncStatus) GetTitle() string { + if e == nil { + return "" + } + return e.Title +} + +// GetBudgets returns the Budgets slice if it's non-nil, nil otherwise. +func (e *EnterpriseListBudgets) GetBudgets() []*EnterpriseBudget { + if e == nil || e.Budgets == nil { + return nil + } + return e.Budgets +} + +// GetHasNextPage returns the HasNextPage field if it's non-nil, zero value otherwise. +func (e *EnterpriseListBudgets) GetHasNextPage() bool { + if e == nil || e.HasNextPage == nil { + return false + } + return *e.HasNextPage +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (e *EnterpriseListBudgets) GetTotalCount() int { + if e == nil || e.TotalCount == nil { + return 0 + } + return *e.TotalCount +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetAllowsPublicRepositories() bool { if e == nil || e.AllowsPublicRepositories == nil { @@ -9582,6 +13430,14 @@ func (e *EnterpriseRunnerGroup) GetDefault() bool { return *e.Default } +// GetHostedRunnersURL returns the HostedRunnersURL field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetHostedRunnersURL() string { + if e == nil || e.HostedRunnersURL == nil { + return "" + } + return *e.HostedRunnersURL +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetID() int64 { if e == nil || e.ID == nil { @@ -9606,6 +13462,14 @@ func (e *EnterpriseRunnerGroup) GetName() string { return *e.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetNetworkConfigurationID() string { + if e == nil || e.NetworkConfigurationID == nil { + return "" + } + return *e.NetworkConfigurationID +} + // GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetRestrictedToWorkflows() bool { if e == nil || e.RestrictedToWorkflows == nil { @@ -9630,6 +13494,14 @@ func (e *EnterpriseRunnerGroup) GetSelectedOrganizationsURL() string { return *e.SelectedOrganizationsURL } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (e *EnterpriseRunnerGroup) GetSelectedWorkflows() []string { + if e == nil || e.SelectedWorkflows == nil { + return nil + } + return e.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetVisibility() string { if e == nil || e.Visibility == nil { @@ -9646,6 +13518,14 @@ func (e *EnterpriseRunnerGroup) GetWorkflowRestrictionsReadOnly() bool { return *e.WorkflowRestrictionsReadOnly } +// GetRunnerGroups returns the RunnerGroups slice if it's non-nil, nil otherwise. +func (e *EnterpriseRunnerGroups) GetRunnerGroups() []*EnterpriseRunnerGroup { + if e == nil || e.RunnerGroups == nil { + return nil + } + return e.RunnerGroups +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroups) GetTotalCount() int { if e == nil || e.TotalCount == nil { @@ -9694,6 +13574,14 @@ func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningValidityChecksEnab return *e.SecretScanningValidityChecksEnabled } +// GetCreatedAt returns the CreatedAt field. +func (e *EnterpriseTeam) GetCreatedAt() Timestamp { + if e == nil { + return Timestamp{} + } + return e.CreatedAt +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (e *EnterpriseTeam) GetDescription() string { if e == nil || e.Description == nil { @@ -9702,6 +13590,46 @@ func (e *EnterpriseTeam) GetDescription() string { return *e.Description } +// GetGroupID returns the GroupID field. +func (e *EnterpriseTeam) GetGroupID() string { + if e == nil { + return "" + } + return e.GroupID +} + +// GetHTMLURL returns the HTMLURL field. +func (e *EnterpriseTeam) GetHTMLURL() string { + if e == nil { + return "" + } + return e.HTMLURL +} + +// GetID returns the ID field. +func (e *EnterpriseTeam) GetID() int64 { + if e == nil { + return 0 + } + return e.ID +} + +// GetMemberURL returns the MemberURL field. +func (e *EnterpriseTeam) GetMemberURL() string { + if e == nil { + return "" + } + return e.MemberURL +} + +// GetName returns the Name field. +func (e *EnterpriseTeam) GetName() string { + if e == nil { + return "" + } + return e.Name +} + // GetOrganizationSelectionType returns the OrganizationSelectionType field if it's non-nil, zero value otherwise. func (e *EnterpriseTeam) GetOrganizationSelectionType() string { if e == nil || e.OrganizationSelectionType == nil { @@ -9710,6 +13638,30 @@ func (e *EnterpriseTeam) GetOrganizationSelectionType() string { return *e.OrganizationSelectionType } +// GetSlug returns the Slug field. +func (e *EnterpriseTeam) GetSlug() string { + if e == nil { + return "" + } + return e.Slug +} + +// GetUpdatedAt returns the UpdatedAt field. +func (e *EnterpriseTeam) GetUpdatedAt() Timestamp { + if e == nil { + return Timestamp{} + } + return e.UpdatedAt +} + +// GetURL returns the URL field. +func (e *EnterpriseTeam) GetURL() string { + if e == nil { + return "" + } + return e.URL +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (e *EnterpriseTeamCreateOrUpdateRequest) GetDescription() string { if e == nil || e.Description == nil { @@ -9726,6 +13678,14 @@ func (e *EnterpriseTeamCreateOrUpdateRequest) GetGroupID() string { return *e.GroupID } +// GetName returns the Name field. +func (e *EnterpriseTeamCreateOrUpdateRequest) GetName() string { + if e == nil { + return "" + } + return e.Name +} + // GetOrganizationSelectionType returns the OrganizationSelectionType field if it's non-nil, zero value otherwise. func (e *EnterpriseTeamCreateOrUpdateRequest) GetOrganizationSelectionType() string { if e == nil || e.OrganizationSelectionType == nil { @@ -9734,6 +13694,62 @@ func (e *EnterpriseTeamCreateOrUpdateRequest) GetOrganizationSelectionType() str return *e.OrganizationSelectionType } +// GetBudgetAlerting returns the BudgetAlerting field. +func (e *EnterpriseUpdateBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting { + if e == nil { + return nil + } + return e.BudgetAlerting +} + +// GetBudgetAmount returns the BudgetAmount field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetAmount() int { + if e == nil || e.BudgetAmount == nil { + return 0 + } + return *e.BudgetAmount +} + +// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetEntityName() string { + if e == nil || e.BudgetEntityName == nil { + return "" + } + return *e.BudgetEntityName +} + +// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetProductSKU() string { + if e == nil || e.BudgetProductSKU == nil { + return "" + } + return *e.BudgetProductSKU +} + +// GetBudgetScope returns the BudgetScope field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetScope() string { + if e == nil || e.BudgetScope == nil { + return "" + } + return *e.BudgetScope +} + +// GetBudgetType returns the BudgetType field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetType() string { + if e == nil || e.BudgetType == nil { + return "" + } + return *e.BudgetType +} + +// GetPreventFurtherUsage returns the PreventFurtherUsage field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetPreventFurtherUsage() bool { + if e == nil || e.PreventFurtherUsage == nil { + return false + } + return *e.PreventFurtherUsage +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (e *Environment) GetCanAdminsBypass() bool { if e == nil || e.CanAdminsBypass == nil { @@ -9806,6 +13822,14 @@ func (e *Environment) GetOwner() string { return *e.Owner } +// GetProtectionRules returns the ProtectionRules slice if it's non-nil, nil otherwise. +func (e *Environment) GetProtectionRules() []*ProtectionRule { + if e == nil || e.ProtectionRules == nil { + return nil + } + return e.ProtectionRules +} + // GetRepo returns the Repo field if it's non-nil, zero value otherwise. func (e *Environment) GetRepo() string { if e == nil || e.Repo == nil { @@ -9814,6 +13838,14 @@ func (e *Environment) GetRepo() string { return *e.Repo } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (e *Environment) GetReviewers() []*EnvReviewers { + if e == nil || e.Reviewers == nil { + return nil + } + return e.Reviewers +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (e *Environment) GetUpdatedAt() Timestamp { if e == nil || e.UpdatedAt == nil { @@ -9838,6 +13870,14 @@ func (e *Environment) GetWaitTimer() int { return *e.WaitTimer } +// GetEnvironments returns the Environments slice if it's non-nil, nil otherwise. +func (e *EnvResponse) GetEnvironments() []*Environment { + if e == nil || e.Environments == nil { + return nil + } + return e.Environments +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (e *EnvResponse) GetTotalCount() int { if e == nil || e.TotalCount == nil { @@ -9862,6 +13902,38 @@ func (e *EnvReviewers) GetType() string { return *e.Type } +// GetCode returns the Code field. +func (e *Error) GetCode() string { + if e == nil { + return "" + } + return e.Code +} + +// GetField returns the Field field. +func (e *Error) GetField() string { + if e == nil { + return "" + } + return e.Field +} + +// GetMessage returns the Message field. +func (e *Error) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + +// GetResource returns the Resource field. +func (e *Error) GetResource() string { + if e == nil { + return "" + } + return e.Resource +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (e *ErrorBlock) GetCreatedAt() Timestamp { if e == nil || e.CreatedAt == nil { @@ -9870,6 +13942,14 @@ func (e *ErrorBlock) GetCreatedAt() Timestamp { return *e.CreatedAt } +// GetReason returns the Reason field. +func (e *ErrorBlock) GetReason() string { + if e == nil { + return "" + } + return e.Reason +} + // GetBlock returns the Block field. func (e *ErrorResponse) GetBlock() *ErrorBlock { if e == nil { @@ -9878,6 +13958,30 @@ func (e *ErrorResponse) GetBlock() *ErrorBlock { return e.Block } +// GetDocumentationURL returns the DocumentationURL field. +func (e *ErrorResponse) GetDocumentationURL() string { + if e == nil { + return "" + } + return e.DocumentationURL +} + +// GetErrors returns the Errors slice if it's non-nil, nil otherwise. +func (e *ErrorResponse) GetErrors() []Error { + if e == nil || e.Errors == nil { + return nil + } + return e.Errors +} + +// GetMessage returns the Message field. +func (e *ErrorResponse) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + // GetActor returns the Actor field. func (e *Event) GetActor() *User { if e == nil { @@ -9958,6 +14062,22 @@ func (e *ExternalGroup) GetGroupName() string { return *e.GroupName } +// GetMembers returns the Members slice if it's non-nil, nil otherwise. +func (e *ExternalGroup) GetMembers() []*ExternalGroupMember { + if e == nil || e.Members == nil { + return nil + } + return e.Members +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (e *ExternalGroup) GetTeams() []*ExternalGroupTeam { + if e == nil || e.Teams == nil { + return nil + } + return e.Teams +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (e *ExternalGroup) GetUpdatedAt() Timestamp { if e == nil || e.UpdatedAt == nil { @@ -9966,6 +14086,14 @@ func (e *ExternalGroup) GetUpdatedAt() Timestamp { return *e.UpdatedAt } +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (e *ExternalGroupList) GetGroups() []*ExternalGroup { + if e == nil || e.Groups == nil { + return nil + } + return e.Groups +} + // GetMemberEmail returns the MemberEmail field if it's non-nil, zero value otherwise. func (e *ExternalGroupMember) GetMemberEmail() string { if e == nil || e.MemberEmail == nil { @@ -10054,6 +14182,14 @@ func (f *FeedLinks) GetCurrentUserOrganization() *FeedLink { return f.CurrentUserOrganization } +// GetCurrentUserOrganizations returns the CurrentUserOrganizations slice if it's non-nil, nil otherwise. +func (f *FeedLinks) GetCurrentUserOrganizations() []*FeedLink { + if f == nil || f.CurrentUserOrganizations == nil { + return nil + } + return f.CurrentUserOrganizations +} + // GetCurrentUserPublic returns the CurrentUserPublic field. func (f *FeedLinks) GetCurrentUserPublic() *FeedLink { if f == nil { @@ -10094,6 +14230,14 @@ func (f *Feeds) GetCurrentUserOrganizationURL() string { return *f.CurrentUserOrganizationURL } +// GetCurrentUserOrganizationURLs returns the CurrentUserOrganizationURLs slice if it's non-nil, nil otherwise. +func (f *Feeds) GetCurrentUserOrganizationURLs() []string { + if f == nil || f.CurrentUserOrganizationURLs == nil { + return nil + } + return f.CurrentUserOrganizationURLs +} + // GetCurrentUserPublicURL returns the CurrentUserPublicURL field if it's non-nil, zero value otherwise. func (f *Feeds) GetCurrentUserPublicURL() string { if f == nil || f.CurrentUserPublicURL == nil { @@ -10158,6 +14302,14 @@ func (f *FieldValue) GetFieldType() string { return *f.FieldType } +// GetFrom returns the From field. +func (f *FieldValue) GetFrom() json.RawMessage { + if f == nil { + return json.RawMessage{} + } + return f.From +} + // GetProjectNumber returns the ProjectNumber field if it's non-nil, zero value otherwise. func (f *FieldValue) GetProjectNumber() int64 { if f == nil || f.ProjectNumber == nil { @@ -10166,6 +14318,142 @@ func (f *FieldValue) GetProjectNumber() int64 { return *f.ProjectNumber } +// GetTo returns the To field. +func (f *FieldValue) GetTo() json.RawMessage { + if f == nil { + return json.RawMessage{} + } + return f.To +} + +// GetParameters returns the Parameters field. +func (f *FileExtensionRestrictionBranchRule) GetParameters() FileExtensionRestrictionRuleParameters { + if f == nil { + return FileExtensionRestrictionRuleParameters{} + } + return f.Parameters +} + +// GetRestrictedFileExtensions returns the RestrictedFileExtensions slice if it's non-nil, nil otherwise. +func (f *FileExtensionRestrictionRuleParameters) GetRestrictedFileExtensions() []string { + if f == nil || f.RestrictedFileExtensions == nil { + return nil + } + return f.RestrictedFileExtensions +} + +// GetParameters returns the Parameters field. +func (f *FilePathRestrictionBranchRule) GetParameters() FilePathRestrictionRuleParameters { + if f == nil { + return FilePathRestrictionRuleParameters{} + } + return f.Parameters +} + +// GetRestrictedFilePaths returns the RestrictedFilePaths slice if it's non-nil, nil otherwise. +func (f *FilePathRestrictionRuleParameters) GetRestrictedFilePaths() []string { + if f == nil || f.RestrictedFilePaths == nil { + return nil + } + return f.RestrictedFilePaths +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (f *FineGrainedPersonalAccessTokenRequest) GetCreatedAt() Timestamp { + if f == nil || f.CreatedAt == nil { + return Timestamp{} + } + return *f.CreatedAt +} + +// GetID returns the ID field. +func (f *FineGrainedPersonalAccessTokenRequest) GetID() int64 { + if f == nil { + return 0 + } + return f.ID +} + +// GetOwner returns the Owner field. +func (f *FineGrainedPersonalAccessTokenRequest) GetOwner() User { + if f == nil { + return User{} + } + return f.Owner +} + +// GetPermissions returns the Permissions field. +func (f *FineGrainedPersonalAccessTokenRequest) GetPermissions() PersonalAccessTokenPermissions { + if f == nil { + return PersonalAccessTokenPermissions{} + } + return f.Permissions +} + +// GetReason returns the Reason field. +func (f *FineGrainedPersonalAccessTokenRequest) GetReason() string { + if f == nil { + return "" + } + return f.Reason +} + +// GetRepositoriesURL returns the RepositoriesURL field. +func (f *FineGrainedPersonalAccessTokenRequest) GetRepositoriesURL() string { + if f == nil { + return "" + } + return f.RepositoriesURL +} + +// GetRepositorySelection returns the RepositorySelection field. +func (f *FineGrainedPersonalAccessTokenRequest) GetRepositorySelection() string { + if f == nil { + return "" + } + return f.RepositorySelection +} + +// GetTokenExpired returns the TokenExpired field. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenExpired() bool { + if f == nil { + return false + } + return f.TokenExpired +} + +// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp { + if f == nil || f.TokenExpiresAt == nil { + return Timestamp{} + } + return *f.TokenExpiresAt +} + +// GetTokenID returns the TokenID field. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenID() int64 { + if f == nil { + return 0 + } + return f.TokenID +} + +// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { + if f == nil || f.TokenLastUsedAt == nil { + return Timestamp{} + } + return *f.TokenLastUsedAt +} + +// GetTokenName returns the TokenName field. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenName() string { + if f == nil { + return "" + } + return f.TokenName +} + // GetIdentifier returns the Identifier field if it's non-nil, zero value otherwise. func (f *FirstPatchedVersion) GetIdentifier() string { if f == nil || f.Identifier == nil { @@ -10206,6 +14494,30 @@ func (f *ForkEvent) GetSender() *User { return f.Sender } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (g *GenerateJITConfigRequest) GetLabels() []string { + if g == nil || g.Labels == nil { + return nil + } + return g.Labels +} + +// GetName returns the Name field. +func (g *GenerateJITConfigRequest) GetName() string { + if g == nil { + return "" + } + return g.Name +} + +// GetRunnerGroupID returns the RunnerGroupID field. +func (g *GenerateJITConfigRequest) GetRunnerGroupID() int64 { + if g == nil { + return 0 + } + return g.RunnerGroupID +} + // GetWorkFolder returns the WorkFolder field if it's non-nil, zero value otherwise. func (g *GenerateJITConfigRequest) GetWorkFolder() string { if g == nil || g.WorkFolder == nil { @@ -10230,6 +14542,14 @@ func (g *GenerateNotesOptions) GetPreviousTagName() string { return *g.PreviousTagName } +// GetTagName returns the TagName field. +func (g *GenerateNotesOptions) GetTagName() string { + if g == nil { + return "" + } + return g.TagName +} + // GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. func (g *GenerateNotesOptions) GetTargetCommitish() string { if g == nil || g.TargetCommitish == nil { @@ -10262,6 +14582,22 @@ func (g *GetAuditLogOptions) GetPhrase() string { return *g.Phrase } +// GetRef returns the Ref field. +func (g *GetCodeownersErrorsOptions) GetRef() string { + if g == nil { + return "" + } + return g.Ref +} + +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (g *GetProjectItemOptions) GetFields() []int64 { + if g == nil || g.Fields == nil { + return nil + } + return g.Fields +} + // GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise. func (g *GetProvisionedSCIMGroupEnterpriseOptions) GetExcludedAttributes() string { if g == nil || g.ExcludedAttributes == nil { @@ -10550,6 +14886,14 @@ func (g *GistFork) GetUser() *User { return g.User } +// GetSince returns the Since field. +func (g *GistListOptions) GetSince() time.Time { + if g == nil { + return time.Time{} + } + return g.Since +} + // GetPrivateGists returns the PrivateGists field if it's non-nil, zero value otherwise. func (g *GistStats) GetPrivateGists() int { if g == nil || g.PrivateGists == nil { @@ -10638,6 +14982,14 @@ func (g *GitObject) GetURL() string { return *g.URL } +// GetCredits returns the Credits slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityAdvisory) GetCredits() []*Credit { + if g == nil || g.Credits == nil { + return nil + } + return g.Credits +} + // GetGithubReviewedAt returns the GithubReviewedAt field if it's non-nil, zero value otherwise. func (g *GlobalSecurityAdvisory) GetGithubReviewedAt() Timestamp { if g == nil || g.GithubReviewedAt == nil { @@ -10662,6 +15014,14 @@ func (g *GlobalSecurityAdvisory) GetNVDPublishedAt() Timestamp { return *g.NVDPublishedAt } +// GetReferences returns the References slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityAdvisory) GetReferences() []string { + if g == nil || g.References == nil { + return nil + } + return g.References +} + // GetRepositoryAdvisoryURL returns the RepositoryAdvisoryURL field if it's non-nil, zero value otherwise. func (g *GlobalSecurityAdvisory) GetRepositoryAdvisoryURL() string { if g == nil || g.RepositoryAdvisoryURL == nil { @@ -10686,6 +15046,14 @@ func (g *GlobalSecurityAdvisory) GetType() string { return *g.Type } +// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityAdvisory) GetVulnerabilities() []*GlobalSecurityVulnerability { + if g == nil || g.Vulnerabilities == nil { + return nil + } + return g.Vulnerabilities +} + // GetFirstPatchedVersion returns the FirstPatchedVersion field if it's non-nil, zero value otherwise. func (g *GlobalSecurityVulnerability) GetFirstPatchedVersion() string { if g == nil || g.FirstPatchedVersion == nil { @@ -10702,6 +15070,14 @@ func (g *GlobalSecurityVulnerability) GetPackage() *VulnerabilityPackage { return g.Package } +// GetVulnerableFunctions returns the VulnerableFunctions slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityVulnerability) GetVulnerableFunctions() []string { + if g == nil || g.VulnerableFunctions == nil { + return nil + } + return g.VulnerableFunctions +} + // GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise. func (g *GlobalSecurityVulnerability) GetVulnerableVersionRange() string { if g == nil || g.VulnerableVersionRange == nil { @@ -10726,6 +15102,14 @@ func (g *GollumEvent) GetOrg() *Organization { return g.Org } +// GetPages returns the Pages slice if it's non-nil, nil otherwise. +func (g *GollumEvent) GetPages() []*Page { + if g == nil || g.Pages == nil { + return nil + } + return g.Pages +} + // GetRepo returns the Repo field. func (g *GollumEvent) GetRepo() *Repository { if g == nil { @@ -10742,6 +15126,30 @@ func (g *GollumEvent) GetSender() *User { return g.Sender } +// GetBucket returns the Bucket field. +func (g *GoogleCloudConfig) GetBucket() string { + if g == nil { + return "" + } + return g.Bucket +} + +// GetEncryptedJSONCredentials returns the EncryptedJSONCredentials field. +func (g *GoogleCloudConfig) GetEncryptedJSONCredentials() string { + if g == nil { + return "" + } + return g.EncryptedJSONCredentials +} + +// GetKeyID returns the KeyID field. +func (g *GoogleCloudConfig) GetKeyID() string { + if g == nil { + return "" + } + return g.KeyID +} + // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (g *GPGEmail) GetEmail() string { if g == nil || g.Email == nil { @@ -10798,6 +15206,14 @@ func (g *GPGKey) GetCreatedAt() Timestamp { return *g.CreatedAt } +// GetEmails returns the Emails slice if it's non-nil, nil otherwise. +func (g *GPGKey) GetEmails() []*GPGEmail { + if g == nil || g.Emails == nil { + return nil + } + return g.Emails +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (g *GPGKey) GetExpiresAt() Timestamp { if g == nil || g.ExpiresAt == nil { @@ -10846,6 +15262,14 @@ func (g *GPGKey) GetRawKey() string { return *g.RawKey } +// GetSubkeys returns the Subkeys slice if it's non-nil, nil otherwise. +func (g *GPGKey) GetSubkeys() []*GPGKey { + if g == nil || g.Subkeys == nil { + return nil + } + return g.Subkeys +} + // GetApp returns the App field. func (g *Grant) GetApp() *AuthorizationApp { if g == nil { @@ -10870,6 +15294,14 @@ func (g *Grant) GetID() int64 { return *g.ID } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (g *Grant) GetScopes() []string { + if g == nil || g.Scopes == nil { + return nil + } + return g.Scopes +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (g *Grant) GetUpdatedAt() Timestamp { if g == nil || g.UpdatedAt == nil { @@ -10886,6 +15318,14 @@ func (g *Grant) GetURL() string { return *g.URL } +// GetAdded returns the Added slice if it's non-nil, nil otherwise. +func (h *HeadCommit) GetAdded() []string { + if h == nil || h.Added == nil { + return nil + } + return h.Added +} + // GetAuthor returns the Author field. func (h *HeadCommit) GetAuthor() *CommitAuthor { if h == nil { @@ -10926,6 +15366,22 @@ func (h *HeadCommit) GetMessage() string { return *h.Message } +// GetModified returns the Modified slice if it's non-nil, nil otherwise. +func (h *HeadCommit) GetModified() []string { + if h == nil || h.Modified == nil { + return nil + } + return h.Modified +} + +// GetRemoved returns the Removed slice if it's non-nil, nil otherwise. +func (h *HeadCommit) GetRemoved() []string { + if h == nil || h.Removed == nil { + return nil + } + return h.Removed +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (h *HeadCommit) GetSHA() string { if h == nil || h.SHA == nil { @@ -10958,6 +15414,54 @@ func (h *HeadCommit) GetURL() string { return *h.URL } +// GetDomain returns the Domain field. +func (h *HecConfig) GetDomain() string { + if h == nil { + return "" + } + return h.Domain +} + +// GetEncryptedToken returns the EncryptedToken field. +func (h *HecConfig) GetEncryptedToken() string { + if h == nil { + return "" + } + return h.EncryptedToken +} + +// GetKeyID returns the KeyID field. +func (h *HecConfig) GetKeyID() string { + if h == nil { + return "" + } + return h.KeyID +} + +// GetPath returns the Path field. +func (h *HecConfig) GetPath() string { + if h == nil { + return "" + } + return h.Path +} + +// GetPort returns the Port field. +func (h *HecConfig) GetPort() uint16 { + if h == nil { + return 0 + } + return h.Port +} + +// GetSSLVerify returns the SSLVerify field. +func (h *HecConfig) GetSSLVerify() bool { + if h == nil { + return false + } + return h.SSLVerify +} + // GetActive returns the Active field if it's non-nil, zero value otherwise. func (h *Hook) GetActive() bool { if h == nil || h.Active == nil { @@ -10982,6 +15486,14 @@ func (h *Hook) GetCreatedAt() Timestamp { return *h.CreatedAt } +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (h *Hook) GetEvents() []string { + if h == nil || h.Events == nil { + return nil + } + return h.Events +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (h *Hook) GetID() int64 { if h == nil || h.ID == nil { @@ -11094,12 +15606,12 @@ func (h *HookDelivery) GetDeliveredAt() Timestamp { return *h.DeliveredAt } -// GetDuration returns the Duration field. -func (h *HookDelivery) GetDuration() *float64 { - if h == nil { - return nil +// GetDuration returns the Duration field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetDuration() float64 { + if h == nil || h.Duration == nil { + return 0 } - return h.Duration + return *h.Duration } // GetEvent returns the Event field if it's non-nil, zero value otherwise. @@ -11302,6 +15814,14 @@ func (h *HostedRunner) GetPublicIPEnabled() bool { return *h.PublicIPEnabled } +// GetPublicIPs returns the PublicIPs slice if it's non-nil, nil otherwise. +func (h *HostedRunner) GetPublicIPs() []*HostedRunnerPublicIP { + if h == nil || h.PublicIPs == nil { + return nil + } + return h.PublicIPs +} + // GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. func (h *HostedRunner) GetRunnerGroupID() int64 { if h == nil || h.RunnerGroupID == nil { @@ -11318,6 +15838,166 @@ func (h *HostedRunner) GetStatus() string { return *h.Status } +// GetID returns the ID field. +func (h *HostedRunnerCustomImage) GetID() int64 { + if h == nil { + return 0 + } + return h.ID +} + +// GetLatestVersion returns the LatestVersion field. +func (h *HostedRunnerCustomImage) GetLatestVersion() string { + if h == nil { + return "" + } + return h.LatestVersion +} + +// GetName returns the Name field. +func (h *HostedRunnerCustomImage) GetName() string { + if h == nil { + return "" + } + return h.Name +} + +// GetPlatform returns the Platform field. +func (h *HostedRunnerCustomImage) GetPlatform() string { + if h == nil { + return "" + } + return h.Platform +} + +// GetSource returns the Source field. +func (h *HostedRunnerCustomImage) GetSource() string { + if h == nil { + return "" + } + return h.Source +} + +// GetState returns the State field. +func (h *HostedRunnerCustomImage) GetState() string { + if h == nil { + return "" + } + return h.State +} + +// GetTotalVersionsSize returns the TotalVersionsSize field. +func (h *HostedRunnerCustomImage) GetTotalVersionsSize() int { + if h == nil { + return 0 + } + return h.TotalVersionsSize +} + +// GetVersionsCount returns the VersionsCount field. +func (h *HostedRunnerCustomImage) GetVersionsCount() int { + if h == nil { + return 0 + } + return h.VersionsCount +} + +// GetImages returns the Images slice if it's non-nil, nil otherwise. +func (h *HostedRunnerCustomImages) GetImages() []*HostedRunnerCustomImage { + if h == nil || h.Images == nil { + return nil + } + return h.Images +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerCustomImages) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetCreatedOn returns the CreatedOn field. +func (h *HostedRunnerCustomImageVersion) GetCreatedOn() Timestamp { + if h == nil { + return Timestamp{} + } + return h.CreatedOn +} + +// GetSizeGB returns the SizeGB field. +func (h *HostedRunnerCustomImageVersion) GetSizeGB() int { + if h == nil { + return 0 + } + return h.SizeGB +} + +// GetState returns the State field. +func (h *HostedRunnerCustomImageVersion) GetState() string { + if h == nil { + return "" + } + return h.State +} + +// GetStateDetails returns the StateDetails field. +func (h *HostedRunnerCustomImageVersion) GetStateDetails() string { + if h == nil { + return "" + } + return h.StateDetails +} + +// GetVersion returns the Version field. +func (h *HostedRunnerCustomImageVersion) GetVersion() string { + if h == nil { + return "" + } + return h.Version +} + +// GetImageVersions returns the ImageVersions slice if it's non-nil, nil otherwise. +func (h *HostedRunnerCustomImageVersions) GetImageVersions() []*HostedRunnerCustomImageVersion { + if h == nil || h.ImageVersions == nil { + return nil + } + return h.ImageVersions +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerCustomImageVersions) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetID returns the ID field. +func (h *HostedRunnerImage) GetID() string { + if h == nil { + return "" + } + return h.ID +} + +// GetSource returns the Source field. +func (h *HostedRunnerImage) GetSource() string { + if h == nil { + return "" + } + return h.Source +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImage) GetVersion() string { + if h == nil || h.Version == nil { + return "" + } + return *h.Version +} + // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. func (h *HostedRunnerImageDetail) GetDisplayName() string { if h == nil || h.DisplayName == nil { @@ -11358,6 +16038,150 @@ func (h *HostedRunnerImageDetail) GetVersion() string { return *h.Version } +// GetImages returns the Images slice if it's non-nil, nil otherwise. +func (h *HostedRunnerImages) GetImages() []*HostedRunnerImageSpecs { + if h == nil || h.Images == nil { + return nil + } + return h.Images +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerImages) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetDisplayName returns the DisplayName field. +func (h *HostedRunnerImageSpecs) GetDisplayName() string { + if h == nil { + return "" + } + return h.DisplayName +} + +// GetID returns the ID field. +func (h *HostedRunnerImageSpecs) GetID() string { + if h == nil { + return "" + } + return h.ID +} + +// GetPlatform returns the Platform field. +func (h *HostedRunnerImageSpecs) GetPlatform() string { + if h == nil { + return "" + } + return h.Platform +} + +// GetSizeGB returns the SizeGB field. +func (h *HostedRunnerImageSpecs) GetSizeGB() int { + if h == nil { + return 0 + } + return h.SizeGB +} + +// GetSource returns the Source field. +func (h *HostedRunnerImageSpecs) GetSource() string { + if h == nil { + return "" + } + return h.Source +} + +// GetCPUCores returns the CPUCores field. +func (h *HostedRunnerMachineSpec) GetCPUCores() int { + if h == nil { + return 0 + } + return h.CPUCores +} + +// GetID returns the ID field. +func (h *HostedRunnerMachineSpec) GetID() string { + if h == nil { + return "" + } + return h.ID +} + +// GetMemoryGB returns the MemoryGB field. +func (h *HostedRunnerMachineSpec) GetMemoryGB() int { + if h == nil { + return 0 + } + return h.MemoryGB +} + +// GetStorageGB returns the StorageGB field. +func (h *HostedRunnerMachineSpec) GetStorageGB() int { + if h == nil { + return 0 + } + return h.StorageGB +} + +// GetMachineSpecs returns the MachineSpecs slice if it's non-nil, nil otherwise. +func (h *HostedRunnerMachineSpecs) GetMachineSpecs() []*HostedRunnerMachineSpec { + if h == nil || h.MachineSpecs == nil { + return nil + } + return h.MachineSpecs +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerMachineSpecs) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetPlatforms returns the Platforms slice if it's non-nil, nil otherwise. +func (h *HostedRunnerPlatforms) GetPlatforms() []string { + if h == nil || h.Platforms == nil { + return nil + } + return h.Platforms +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerPlatforms) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetEnabled returns the Enabled field. +func (h *HostedRunnerPublicIP) GetEnabled() bool { + if h == nil { + return false + } + return h.Enabled +} + +// GetLength returns the Length field. +func (h *HostedRunnerPublicIP) GetLength() int { + if h == nil { + return 0 + } + return h.Length +} + +// GetPrefix returns the Prefix field. +func (h *HostedRunnerPublicIP) GetPrefix() string { + if h == nil { + return "" + } + return h.Prefix +} + // GetPublicIPs returns the PublicIPs field. func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage { if h == nil { @@ -11366,6 +16190,46 @@ func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage { return h.PublicIPs } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (h *HostedRunners) GetRunners() []*HostedRunner { + if h == nil || h.Runners == nil { + return nil + } + return h.Runners +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunners) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetContexts returns the Contexts slice if it's non-nil, nil otherwise. +func (h *Hovercard) GetContexts() []*UserContext { + if h == nil || h.Contexts == nil { + return nil + } + return h.Contexts +} + +// GetSubjectID returns the SubjectID field. +func (h *HovercardOptions) GetSubjectID() string { + if h == nil { + return "" + } + return h.SubjectID +} + +// GetSubjectType returns the SubjectType field. +func (h *HovercardOptions) GetSubjectType() string { + if h == nil { + return "" + } + return h.SubjectType +} + // GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise. func (i *IDPGroup) GetGroupDescription() string { if i == nil || i.GroupDescription == nil { @@ -11390,6 +16254,14 @@ func (i *IDPGroup) GetGroupName() string { return *i.GroupName } +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (i *IDPGroupList) GetGroups() []*IDPGroup { + if i == nil || i.Groups == nil { + return nil + } + return i.Groups +} + // GetEnforcedRepositories returns the EnforcedRepositories field if it's non-nil, zero value otherwise. func (i *ImmutableReleasePolicy) GetEnforcedRepositories() string { if i == nil || i.EnforcedRepositories == nil { @@ -11398,6 +16270,14 @@ func (i *ImmutableReleasePolicy) GetEnforcedRepositories() string { return *i.EnforcedRepositories } +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (i *ImmutableReleasePolicy) GetSelectedRepositoryIDs() []int64 { + if i == nil || i.SelectedRepositoryIDs == nil { + return nil + } + return i.SelectedRepositoryIDs +} + // GetEnforcedRepositories returns the EnforcedRepositories field if it's non-nil, zero value otherwise. func (i *ImmutableReleaseSettings) GetEnforcedRepositories() string { if i == nil || i.EnforcedRepositories == nil { @@ -11414,6 +16294,14 @@ func (i *ImmutableReleaseSettings) GetSelectedRepositoriesURL() string { return *i.SelectedRepositoriesURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (i *ImpersonateUserOptions) GetScopes() []string { + if i == nil || i.Scopes == nil { + return nil + } + return i.Scopes +} + // GetAuthorsCount returns the AuthorsCount field if it's non-nil, zero value otherwise. func (i *Import) GetAuthorsCount() int { if i == nil || i.AuthorsCount == nil { @@ -11502,6 +16390,14 @@ func (i *Import) GetPercent() int { return *i.Percent } +// GetProjectChoices returns the ProjectChoices slice if it's non-nil, nil otherwise. +func (i *Import) GetProjectChoices() []*Import { + if i == nil || i.ProjectChoices == nil { + return nil + } + return i.ProjectChoices +} + // GetPushPercent returns the PushPercent field if it's non-nil, zero value otherwise. func (i *Import) GetPushPercent() int { if i == nil || i.PushPercent == nil { @@ -11590,6 +16486,22 @@ func (i *Import) GetVCSUsername() string { return *i.VCSUsername } +// GetLicense returns the License field. +func (i *InitialConfigOptions) GetLicense() string { + if i == nil { + return "" + } + return i.License +} + +// GetPassword returns the Password field. +func (i *InitialConfigOptions) GetPassword() string { + if i == nil { + return "" + } + return i.Password +} + // GetAccessibleRepositoriesURL returns the AccessibleRepositoriesURL field if it's non-nil, zero value otherwise. func (i *InstallableOrganization) GetAccessibleRepositoriesURL() string { if i == nil || i.AccessibleRepositoriesURL == nil { @@ -11598,6 +16510,46 @@ func (i *InstallableOrganization) GetAccessibleRepositoriesURL() string { return *i.AccessibleRepositoriesURL } +// GetID returns the ID field. +func (i *InstallableOrganization) GetID() int64 { + if i == nil { + return 0 + } + return i.ID +} + +// GetLogin returns the Login field. +func (i *InstallableOrganization) GetLogin() string { + if i == nil { + return "" + } + return i.Login +} + +// GetClientID returns the ClientID field. +func (i *InstallAppRequest) GetClientID() string { + if i == nil { + return "" + } + return i.ClientID +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallAppRequest) GetRepositories() []string { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + +// GetRepositorySelection returns the RepositorySelection field. +func (i *InstallAppRequest) GetRepositorySelection() string { + if i == nil { + return "" + } + return i.RepositorySelection +} + // GetAccessTokensURL returns the AccessTokensURL field if it's non-nil, zero value otherwise. func (i *Installation) GetAccessTokensURL() string { if i == nil || i.AccessTokensURL == nil { @@ -11646,6 +16598,14 @@ func (i *Installation) GetCreatedAt() Timestamp { return *i.CreatedAt } +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (i *Installation) GetEvents() []string { + if i == nil || i.Events == nil { + return nil + } + return i.Events +} + // GetHasMultipleSingleFiles returns the HasMultipleSingleFiles field if it's non-nil, zero value otherwise. func (i *Installation) GetHasMultipleSingleFiles() bool { if i == nil || i.HasMultipleSingleFiles == nil { @@ -11710,6 +16670,14 @@ func (i *Installation) GetSingleFileName() string { return *i.SingleFileName } +// GetSingleFilePaths returns the SingleFilePaths slice if it's non-nil, nil otherwise. +func (i *Installation) GetSingleFilePaths() []string { + if i == nil || i.SingleFilePaths == nil { + return nil + } + return i.SingleFilePaths +} + // GetSuspendedAt returns the SuspendedAt field if it's non-nil, zero value otherwise. func (i *Installation) GetSuspendedAt() Timestamp { if i == nil || i.SuspendedAt == nil { @@ -11790,6 +16758,14 @@ func (i *InstallationEvent) GetOrg() *Organization { return i.Org } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationEvent) GetRepositories() []*Repository { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + // GetRequester returns the Requester field. func (i *InstallationEvent) GetRequester() *User { if i == nil { @@ -12102,6 +17078,14 @@ func (i *InstallationPermissions) GetOrganizationCodespacesSettings() string { return *i.OrganizationCodespacesSettings } +// GetOrganizationCopilotMetrics returns the OrganizationCopilotMetrics field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCopilotMetrics() string { + if i == nil || i.OrganizationCopilotMetrics == nil { + return "" + } + return *i.OrganizationCopilotMetrics +} + // GetOrganizationCopilotSeatManagement returns the OrganizationCopilotSeatManagement field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationCopilotSeatManagement() string { if i == nil || i.OrganizationCopilotSeatManagement == nil { @@ -12430,6 +17414,22 @@ func (i *InstallationRepositoriesEvent) GetOrg() *Organization { return i.Org } +// GetRepositoriesAdded returns the RepositoriesAdded slice if it's non-nil, nil otherwise. +func (i *InstallationRepositoriesEvent) GetRepositoriesAdded() []*Repository { + if i == nil || i.RepositoriesAdded == nil { + return nil + } + return i.RepositoriesAdded +} + +// GetRepositoriesRemoved returns the RepositoriesRemoved slice if it's non-nil, nil otherwise. +func (i *InstallationRepositoriesEvent) GetRepositoriesRemoved() []*Repository { + if i == nil || i.RepositoriesRemoved == nil { + return nil + } + return i.RepositoriesRemoved +} + // GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. func (i *InstallationRepositoriesEvent) GetRepositorySelection() string { if i == nil || i.RepositorySelection == nil { @@ -12582,6 +17582,14 @@ func (i *InstallationToken) GetPermissions() *InstallationPermissions { return i.Permissions } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationToken) GetRepositories() []*Repository { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + // GetToken returns the Token field if it's non-nil, zero value otherwise. func (i *InstallationToken) GetToken() string { if i == nil || i.Token == nil { @@ -12598,6 +17606,22 @@ func (i *InstallationTokenListRepoOptions) GetPermissions() *InstallationPermiss return i.Permissions } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationTokenListRepoOptions) GetRepositories() []string { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + +// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise. +func (i *InstallationTokenListRepoOptions) GetRepositoryIDs() []int64 { + if i == nil || i.RepositoryIDs == nil { + return nil + } + return i.RepositoryIDs +} + // GetPermissions returns the Permissions field. func (i *InstallationTokenOptions) GetPermissions() *InstallationPermissions { if i == nil { @@ -12606,6 +17630,22 @@ func (i *InstallationTokenOptions) GetPermissions() *InstallationPermissions { return i.Permissions } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationTokenOptions) GetRepositories() []string { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + +// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise. +func (i *InstallationTokenOptions) GetRepositoryIDs() []int64 { + if i == nil || i.RepositoryIDs == nil { + return nil + } + return i.RepositoryIDs +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (i *InteractionRestriction) GetExpiresAt() Timestamp { if i == nil || i.ExpiresAt == nil { @@ -12734,6 +17774,14 @@ func (i *Issue) GetAssignee() *User { return i.Assignee } +// GetAssignees returns the Assignees slice if it's non-nil, nil otherwise. +func (i *Issue) GetAssignees() []*User { + if i == nil || i.Assignees == nil { + return nil + } + return i.Assignees +} + // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. func (i *Issue) GetAuthorAssociation() string { if i == nil || i.AuthorAssociation == nil { @@ -12822,6 +17870,14 @@ func (i *Issue) GetID() int64 { return *i.ID } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *Issue) GetLabels() []*Label { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + // GetLabelsURL returns the LabelsURL field if it's non-nil, zero value otherwise. func (i *Issue) GetLabelsURL() string { if i == nil || i.LabelsURL == nil { @@ -12918,6 +17974,14 @@ func (i *Issue) GetStateReason() string { return *i.StateReason } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (i *Issue) GetTextMatches() []*TextMatch { + if i == nil || i.TextMatches == nil { + return nil + } + return i.TextMatches +} + // GetTitle returns the Title field if it's non-nil, zero value otherwise. func (i *Issue) GetTitle() string { if i == nil || i.Title == nil { @@ -13110,6 +18174,14 @@ func (i *IssueCommentEvent) GetSender() *User { return i.Sender } +// GetAction returns the Action field. +func (i *IssueEvent) GetAction() string { + if i == nil { + return "" + } + return i.Action +} + // GetActor returns the Actor field. func (i *IssueEvent) GetActor() *User { if i == nil { @@ -13270,6 +18342,14 @@ func (i *IssueImport) GetAssignee() string { return *i.Assignee } +// GetBody returns the Body field. +func (i *IssueImport) GetBody() string { + if i == nil { + return "" + } + return i.Body +} + // GetClosed returns the Closed field if it's non-nil, zero value otherwise. func (i *IssueImport) GetClosed() bool { if i == nil || i.Closed == nil { @@ -13294,6 +18374,14 @@ func (i *IssueImport) GetCreatedAt() Timestamp { return *i.CreatedAt } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *IssueImport) GetLabels() []string { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + // GetMilestone returns the Milestone field if it's non-nil, zero value otherwise. func (i *IssueImport) GetMilestone() int { if i == nil || i.Milestone == nil { @@ -13302,6 +18390,14 @@ func (i *IssueImport) GetMilestone() int { return *i.Milestone } +// GetTitle returns the Title field. +func (i *IssueImport) GetTitle() string { + if i == nil { + return "" + } + return i.Title +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (i *IssueImport) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { @@ -13350,6 +18446,22 @@ func (i *IssueImportError) GetValue() string { return *i.Value } +// GetComments returns the Comments slice if it's non-nil, nil otherwise. +func (i *IssueImportRequest) GetComments() []*Comment { + if i == nil || i.Comments == nil { + return nil + } + return i.Comments +} + +// GetIssueImport returns the IssueImport field. +func (i *IssueImportRequest) GetIssueImport() IssueImport { + if i == nil { + return IssueImport{} + } + return i.IssueImport +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (i *IssueImportResponse) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { @@ -13366,6 +18478,14 @@ func (i *IssueImportResponse) GetDocumentationURL() string { return *i.DocumentationURL } +// GetErrors returns the Errors slice if it's non-nil, nil otherwise. +func (i *IssueImportResponse) GetErrors() []*IssueImportError { + if i == nil || i.Errors == nil { + return nil + } + return i.Errors +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (i *IssueImportResponse) GetID() int { if i == nil || i.ID == nil { @@ -13422,6 +18542,142 @@ func (i *IssueImportResponse) GetURL() string { return *i.URL } +// GetDirection returns the Direction field. +func (i *IssueListByOrgOptions) GetDirection() string { + if i == nil { + return "" + } + return i.Direction +} + +// GetFilter returns the Filter field. +func (i *IssueListByOrgOptions) GetFilter() string { + if i == nil { + return "" + } + return i.Filter +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *IssueListByOrgOptions) GetLabels() []string { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + +// GetSince returns the Since field. +func (i *IssueListByOrgOptions) GetSince() time.Time { + if i == nil { + return time.Time{} + } + return i.Since +} + +// GetSort returns the Sort field. +func (i *IssueListByOrgOptions) GetSort() string { + if i == nil { + return "" + } + return i.Sort +} + +// GetState returns the State field. +func (i *IssueListByOrgOptions) GetState() string { + if i == nil { + return "" + } + return i.State +} + +// GetType returns the Type field. +func (i *IssueListByOrgOptions) GetType() string { + if i == nil { + return "" + } + return i.Type +} + +// GetAssignee returns the Assignee field. +func (i *IssueListByRepoOptions) GetAssignee() string { + if i == nil { + return "" + } + return i.Assignee +} + +// GetCreator returns the Creator field. +func (i *IssueListByRepoOptions) GetCreator() string { + if i == nil { + return "" + } + return i.Creator +} + +// GetDirection returns the Direction field. +func (i *IssueListByRepoOptions) GetDirection() string { + if i == nil { + return "" + } + return i.Direction +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *IssueListByRepoOptions) GetLabels() []string { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + +// GetMentioned returns the Mentioned field. +func (i *IssueListByRepoOptions) GetMentioned() string { + if i == nil { + return "" + } + return i.Mentioned +} + +// GetMilestone returns the Milestone field. +func (i *IssueListByRepoOptions) GetMilestone() string { + if i == nil { + return "" + } + return i.Milestone +} + +// GetSince returns the Since field. +func (i *IssueListByRepoOptions) GetSince() time.Time { + if i == nil { + return time.Time{} + } + return i.Since +} + +// GetSort returns the Sort field. +func (i *IssueListByRepoOptions) GetSort() string { + if i == nil { + return "" + } + return i.Sort +} + +// GetState returns the State field. +func (i *IssueListByRepoOptions) GetState() string { + if i == nil { + return "" + } + return i.State +} + +// GetType returns the Type field. +func (i *IssueListByRepoOptions) GetType() string { + if i == nil { + return "" + } + return i.Type +} + // GetDirection returns the Direction field if it's non-nil, zero value otherwise. func (i *IssueListCommentsOptions) GetDirection() string { if i == nil || i.Direction == nil { @@ -13606,6 +18862,14 @@ func (i *IssuesSearchResult) GetIncompleteResults() bool { return *i.IncompleteResults } +// GetIssues returns the Issues slice if it's non-nil, nil otherwise. +func (i *IssuesSearchResult) GetIssues() []*Issue { + if i == nil || i.Issues == nil { + return nil + } + return i.Issues +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (i *IssuesSearchResult) GetTotal() int { if i == nil || i.Total == nil { @@ -13710,6 +18974,14 @@ func (j *JITRunnerConfig) GetRunner() *Runner { return j.Runner } +// GetJobs returns the Jobs slice if it's non-nil, nil otherwise. +func (j *Jobs) GetJobs() []*WorkflowJob { + if j == nil || j.Jobs == nil { + return nil + } + return j.Jobs +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (j *Jobs) GetTotalCount() int { if j == nil || j.TotalCount == nil { @@ -13942,12 +19214,12 @@ func (l *LabelResult) GetName() string { return *l.Name } -// GetScore returns the Score field. -func (l *LabelResult) GetScore() *float64 { - if l == nil { - return nil +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (l *LabelResult) GetScore() float64 { + if l == nil || l.Score == nil { + return 0 } - return l.Score + return *l.Score } // GetURL returns the URL field if it's non-nil, zero value otherwise. @@ -13966,6 +19238,14 @@ func (l *LabelsSearchResult) GetIncompleteResults() bool { return *l.IncompleteResults } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (l *LabelsSearchResult) GetLabels() []*LabelResult { + if l == nil || l.Labels == nil { + return nil + } + return l.Labels +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (l *LabelsSearchResult) GetTotal() int { if l == nil || l.Total == nil { @@ -14014,6 +19294,14 @@ func (l *LastLicenseSync) GetProperties() *LastLicenseSyncProperties { return l.Properties } +// GetType returns the Type field. +func (l *LastLicenseSync) GetType() string { + if l == nil { + return "" + } + return l.Type +} + // GetDate returns the Date field if it's non-nil, zero value otherwise. func (l *LastLicenseSyncProperties) GetDate() Timestamp { if l == nil || l.Date == nil { @@ -14022,6 +19310,22 @@ func (l *LastLicenseSyncProperties) GetDate() Timestamp { return *l.Date } +// GetError returns the Error field. +func (l *LastLicenseSyncProperties) GetError() string { + if l == nil { + return "" + } + return l.Error +} + +// GetStatus returns the Status field. +func (l *LastLicenseSyncProperties) GetStatus() string { + if l == nil { + return "" + } + return l.Status +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (l *License) GetBody() string { if l == nil || l.Body == nil { @@ -14334,6 +19638,86 @@ func (l *ListAlertsOptions) GetState() string { return *l.State } +// GetCollab returns the Collab field. +func (l *ListAllIssuesOptions) GetCollab() bool { + if l == nil { + return false + } + return l.Collab +} + +// GetDirection returns the Direction field. +func (l *ListAllIssuesOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetFilter returns the Filter field. +func (l *ListAllIssuesOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (l *ListAllIssuesOptions) GetLabels() []string { + if l == nil || l.Labels == nil { + return nil + } + return l.Labels +} + +// GetOrgs returns the Orgs field. +func (l *ListAllIssuesOptions) GetOrgs() bool { + if l == nil { + return false + } + return l.Orgs +} + +// GetOwned returns the Owned field. +func (l *ListAllIssuesOptions) GetOwned() bool { + if l == nil { + return false + } + return l.Owned +} + +// GetPulls returns the Pulls field. +func (l *ListAllIssuesOptions) GetPulls() bool { + if l == nil { + return false + } + return l.Pulls +} + +// GetSince returns the Since field. +func (l *ListAllIssuesOptions) GetSince() time.Time { + if l == nil { + return time.Time{} + } + return l.Since +} + +// GetSort returns the Sort field. +func (l *ListAllIssuesOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetState returns the State field. +func (l *ListAllIssuesOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (l *ListArtifactsOptions) GetName() string { if l == nil || l.Name == nil { @@ -14374,6 +19758,14 @@ func (l *ListCheckRunsOptions) GetStatus() string { return *l.Status } +// GetCheckRuns returns the CheckRuns slice if it's non-nil, nil otherwise. +func (l *ListCheckRunsResults) GetCheckRuns() []*CheckRun { + if l == nil || l.CheckRuns == nil { + return nil + } + return l.CheckRuns +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (l *ListCheckRunsResults) GetTotal() int { if l == nil || l.Total == nil { @@ -14398,6 +19790,14 @@ func (l *ListCheckSuiteOptions) GetCheckName() string { return *l.CheckName } +// GetCheckSuites returns the CheckSuites slice if it's non-nil, nil otherwise. +func (l *ListCheckSuiteResults) GetCheckSuites() []*CheckSuite { + if l == nil || l.CheckSuites == nil { + return nil + } + return l.CheckSuites +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (l *ListCheckSuiteResults) GetTotal() int { if l == nil || l.Total == nil { @@ -14406,36 +19806,44 @@ func (l *ListCheckSuiteResults) GetTotal() int { return *l.Total } -// GetAfter returns the After field if it's non-nil, zero value otherwise. +// GetAfter returns the After field. func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetAfter() string { - if l == nil || l.After == nil { + if l == nil { return "" } - return *l.After + return l.After } -// GetBefore returns the Before field if it's non-nil, zero value otherwise. +// GetBefore returns the Before field. func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetBefore() string { - if l == nil || l.Before == nil { + if l == nil { return "" } - return *l.Before + return l.Before } -// GetPerPage returns the PerPage field if it's non-nil, zero value otherwise. +// GetPerPage returns the PerPage field. func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetPerPage() int { - if l == nil || l.PerPage == nil { + if l == nil { return 0 } - return *l.PerPage + return l.PerPage } -// GetStatus returns the Status field if it's non-nil, zero value otherwise. +// GetStatus returns the Status field. func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetStatus() string { - if l == nil || l.Status == nil { + if l == nil { return "" } - return *l.Status + return l.Status +} + +// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise. +func (l *ListCodespaces) GetCodespaces() []*Codespace { + if l == nil || l.Codespaces == nil { + return nil + } + return l.Codespaces } // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. @@ -14446,6 +19854,54 @@ func (l *ListCodespaces) GetTotalCount() int { return *l.TotalCount } +// GetRepositoryID returns the RepositoryID field. +func (l *ListCodespacesOptions) GetRepositoryID() int64 { + if l == nil { + return 0 + } + return l.RepositoryID +} + +// GetAffiliation returns the Affiliation field. +func (l *ListCollaboratorsOptions) GetAffiliation() string { + if l == nil { + return "" + } + return l.Affiliation +} + +// GetPermission returns the Permission field. +func (l *ListCollaboratorsOptions) GetPermission() string { + if l == nil { + return "" + } + return l.Permission +} + +// GetAnon returns the Anon field. +func (l *ListContributorsOptions) GetAnon() string { + if l == nil { + return "" + } + return l.Anon +} + +// GetSeats returns the Seats slice if it's non-nil, nil otherwise. +func (l *ListCopilotSeatsResponse) GetSeats() []*CopilotSeatDetails { + if l == nil || l.Seats == nil { + return nil + } + return l.Seats +} + +// GetTotalSeats returns the TotalSeats field. +func (l *ListCopilotSeatsResponse) GetTotalSeats() int64 { + if l == nil { + return 0 + } + return l.TotalSeats +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (l *ListCostCenterOptions) GetState() string { if l == nil || l.State == nil { @@ -14454,6 +19910,70 @@ func (l *ListCostCenterOptions) GetState() string { return *l.State } +// GetAfter returns the After field. +func (l *ListCursorOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListCursorOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetCursor returns the Cursor field. +func (l *ListCursorOptions) GetCursor() string { + if l == nil { + return "" + } + return l.Cursor +} + +// GetFirst returns the First field. +func (l *ListCursorOptions) GetFirst() int { + if l == nil { + return 0 + } + return l.First +} + +// GetLast returns the Last field. +func (l *ListCursorOptions) GetLast() int { + if l == nil { + return 0 + } + return l.Last +} + +// GetPage returns the Page field. +func (l *ListCursorOptions) GetPage() string { + if l == nil { + return "" + } + return l.Page +} + +// GetPerPage returns the PerPage field. +func (l *ListCursorOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetAvailableIntegrations returns the AvailableIntegrations slice if it's non-nil, nil otherwise. +func (l *ListCustomDeploymentRuleIntegrationsResponse) GetAvailableIntegrations() []*CustomDeploymentProtectionRuleApp { + if l == nil || l.AvailableIntegrations == nil { + return nil + } + return l.AvailableIntegrations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14462,6 +19982,22 @@ func (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int { return *l.TotalCount } +// GetRepositoryQuery returns the RepositoryQuery field. +func (l *ListCustomPropertyValuesOptions) GetRepositoryQuery() string { + if l == nil { + return "" + } + return l.RepositoryQuery +} + +// GetProtectionRules returns the ProtectionRules slice if it's non-nil, nil otherwise. +func (l *ListDeploymentProtectionRuleResponse) GetProtectionRules() []*CustomDeploymentProtectionRule { + if l == nil || l.ProtectionRules == nil { + return nil + } + return l.ProtectionRules +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListDeploymentProtectionRuleResponse) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14470,28 +20006,36 @@ func (l *ListDeploymentProtectionRuleResponse) GetTotalCount() int { return *l.TotalCount } -// GetAfter returns the After field if it's non-nil, zero value otherwise. +// GetAfter returns the After field. func (l *ListEnterpriseCodeSecurityConfigurationOptions) GetAfter() string { - if l == nil || l.After == nil { + if l == nil { return "" } - return *l.After + return l.After } -// GetBefore returns the Before field if it's non-nil, zero value otherwise. +// GetBefore returns the Before field. func (l *ListEnterpriseCodeSecurityConfigurationOptions) GetBefore() string { - if l == nil || l.Before == nil { + if l == nil { return "" } - return *l.Before + return l.Before } -// GetPerPage returns the PerPage field if it's non-nil, zero value otherwise. +// GetPerPage returns the PerPage field. func (l *ListEnterpriseCodeSecurityConfigurationOptions) GetPerPage() int { - if l == nil || l.PerPage == nil { + if l == nil { return 0 } - return *l.PerPage + return l.PerPage +} + +// GetVisibleToOrganization returns the VisibleToOrganization field. +func (l *ListEnterpriseRunnerGroupOptions) GetVisibleToOrganization() string { + if l == nil { + return "" + } + return l.VisibleToOrganization } // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. @@ -14502,6 +20046,70 @@ func (l *ListExternalGroupsOptions) GetDisplayName() string { return *l.DisplayName } +// GetDirection returns the Direction field. +func (l *ListFineGrainedPATOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetLastUsedAfter returns the LastUsedAfter field. +func (l *ListFineGrainedPATOptions) GetLastUsedAfter() string { + if l == nil { + return "" + } + return l.LastUsedAfter +} + +// GetLastUsedBefore returns the LastUsedBefore field. +func (l *ListFineGrainedPATOptions) GetLastUsedBefore() string { + if l == nil { + return "" + } + return l.LastUsedBefore +} + +// GetOwner returns the Owner slice if it's non-nil, nil otherwise. +func (l *ListFineGrainedPATOptions) GetOwner() []string { + if l == nil || l.Owner == nil { + return nil + } + return l.Owner +} + +// GetPermission returns the Permission field. +func (l *ListFineGrainedPATOptions) GetPermission() string { + if l == nil { + return "" + } + return l.Permission +} + +// GetRepository returns the Repository field. +func (l *ListFineGrainedPATOptions) GetRepository() string { + if l == nil { + return "" + } + return l.Repository +} + +// GetSort returns the Sort field. +func (l *ListFineGrainedPATOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetTokenID returns the TokenID slice if it's non-nil, nil otherwise. +func (l *ListFineGrainedPATOptions) GetTokenID() []int64 { + if l == nil || l.TokenID == nil { + return nil + } + return l.TokenID +} + // GetAffects returns the Affects field if it's non-nil, zero value otherwise. func (l *ListGlobalSecurityAdvisoriesOptions) GetAffects() string { if l == nil || l.Affects == nil { @@ -14518,6 +20126,14 @@ func (l *ListGlobalSecurityAdvisoriesOptions) GetCVEID() string { return *l.CVEID } +// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetCWEs() []string { + if l == nil || l.CWEs == nil { + return nil + } + return l.CWEs +} + // GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. func (l *ListGlobalSecurityAdvisoriesOptions) GetEcosystem() string { if l == nil || l.Ecosystem == nil { @@ -14582,6 +20198,70 @@ func (l *ListGlobalSecurityAdvisoriesOptions) GetUpdated() string { return *l.Updated } +// GetQuery returns the Query field. +func (l *ListIDPGroupsOptions) GetQuery() string { + if l == nil { + return "" + } + return l.Query +} + +// GetFeatured returns the Featured field if it's non-nil, zero value otherwise. +func (l *ListLicensesOptions) GetFeatured() bool { + if l == nil || l.Featured == nil { + return false + } + return *l.Featured +} + +// GetFilter returns the Filter field. +func (l *ListMembersOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetPublicOnly returns the PublicOnly field. +func (l *ListMembersOptions) GetPublicOnly() bool { + if l == nil { + return false + } + return l.PublicOnly +} + +// GetRole returns the Role field. +func (l *ListMembersOptions) GetRole() string { + if l == nil { + return "" + } + return l.Role +} + +// GetPage returns the Page field. +func (l *ListOptions) GetPage() int { + if l == nil { + return 0 + } + return l.Page +} + +// GetPerPage returns the PerPage field. +func (l *ListOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise. +func (l *ListOrganizations) GetOrganizations() []*Organization { + if l == nil || l.Organizations == nil { + return nil + } + return l.Organizations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListOrganizations) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14590,68 +20270,108 @@ func (l *ListOrganizations) GetTotalCount() int { return *l.TotalCount } -// GetAfter returns the After field if it's non-nil, zero value otherwise. +// GetAfter returns the After field. func (l *ListOrgCodeSecurityConfigurationOptions) GetAfter() string { - if l == nil || l.After == nil { + if l == nil { return "" } - return *l.After + return l.After } -// GetBefore returns the Before field if it's non-nil, zero value otherwise. +// GetBefore returns the Before field. func (l *ListOrgCodeSecurityConfigurationOptions) GetBefore() string { - if l == nil || l.Before == nil { + if l == nil { return "" } - return *l.Before + return l.Before } -// GetPerPage returns the PerPage field if it's non-nil, zero value otherwise. +// GetPerPage returns the PerPage field. func (l *ListOrgCodeSecurityConfigurationOptions) GetPerPage() int { - if l == nil || l.PerPage == nil { + if l == nil { return 0 } - return *l.PerPage + return l.PerPage } -// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise. +// GetTargetType returns the TargetType field. func (l *ListOrgCodeSecurityConfigurationOptions) GetTargetType() string { - if l == nil || l.TargetType == nil { + if l == nil { + return "" + } + return l.TargetType +} + +// GetState returns the State field. +func (l *ListOrgMembershipsOptions) GetState() string { + if l == nil { return "" } - return *l.TargetType + return l.State +} + +// GetVisibleToRepository returns the VisibleToRepository field. +func (l *ListOrgRunnerGroupOptions) GetVisibleToRepository() string { + if l == nil { + return "" + } + return l.VisibleToRepository +} + +// GetFilter returns the Filter field. +func (l *ListOutsideCollaboratorsOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetState returns the State field. +func (l *ListPackageVersionsOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (l *ListProjectItemsOptions) GetFields() []int64 { + if l == nil || l.Fields == nil { + return nil + } + return l.Fields } -// GetQuery returns the Query field if it's non-nil, zero value otherwise. +// GetQuery returns the Query field. func (l *ListProjectsOptions) GetQuery() string { - if l == nil || l.Query == nil { + if l == nil { return "" } - return *l.Query + return l.Query } -// GetAfter returns the After field if it's non-nil, zero value otherwise. +// GetAfter returns the After field. func (l *ListProjectsPaginationOptions) GetAfter() string { - if l == nil || l.After == nil { + if l == nil { return "" } - return *l.After + return l.After } -// GetBefore returns the Before field if it's non-nil, zero value otherwise. +// GetBefore returns the Before field. func (l *ListProjectsPaginationOptions) GetBefore() string { - if l == nil || l.Before == nil { + if l == nil { return "" } - return *l.Before + return l.Before } -// GetPerPage returns the PerPage field if it's non-nil, zero value otherwise. +// GetPerPage returns the PerPage field. func (l *ListProjectsPaginationOptions) GetPerPage() int { - if l == nil || l.PerPage == nil { + if l == nil { return 0 } - return *l.PerPage + return l.PerPage } // GetCount returns the Count field if it's non-nil, zero value otherwise. @@ -14710,6 +20430,14 @@ func (l *ListProvisionedSCIMUsersEnterpriseOptions) GetStartIndex() int { return *l.StartIndex } +// GetContent returns the Content field. +func (l *ListReactionOptions) GetContent() string { + if l == nil { + return "" + } + return l.Content +} + // GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. func (l *ListRepoMachineTypesOptions) GetClientIP() string { if l == nil || l.ClientIP == nil { @@ -14734,6 +20462,14 @@ func (l *ListRepoMachineTypesOptions) GetRef() string { return *l.Ref } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (l *ListRepositories) GetRepositories() []*Repository { + if l == nil || l.Repositories == nil { + return nil + } + return l.Repositories +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListRepositories) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14742,6 +20478,94 @@ func (l *ListRepositories) GetTotalCount() int { return *l.TotalCount } +// GetActivityType returns the ActivityType field. +func (l *ListRepositoryActivityOptions) GetActivityType() string { + if l == nil { + return "" + } + return l.ActivityType +} + +// GetActor returns the Actor field. +func (l *ListRepositoryActivityOptions) GetActor() string { + if l == nil { + return "" + } + return l.Actor +} + +// GetAfter returns the After field. +func (l *ListRepositoryActivityOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListRepositoryActivityOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetDirection returns the Direction field. +func (l *ListRepositoryActivityOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetPerPage returns the PerPage field. +func (l *ListRepositoryActivityOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetRef returns the Ref field. +func (l *ListRepositoryActivityOptions) GetRef() string { + if l == nil { + return "" + } + return l.Ref +} + +// GetTimePeriod returns the TimePeriod field. +func (l *ListRepositoryActivityOptions) GetTimePeriod() string { + if l == nil { + return "" + } + return l.TimePeriod +} + +// GetDirection returns the Direction field. +func (l *ListRepositorySecurityAdvisoriesOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetSort returns the Sort field. +func (l *ListRepositorySecurityAdvisoriesOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetState returns the State field. +func (l *ListRepositorySecurityAdvisoriesOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (l *ListRunnersOptions) GetName() string { if l == nil || l.Name == nil { @@ -14774,6 +20598,126 @@ func (l *ListSCIMProvisionedIdentitiesOptions) GetStartIndex() int { return *l.StartIndex } +// GetDirection returns the Direction field. +func (l *ListUserIssuesOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetFilter returns the Filter field. +func (l *ListUserIssuesOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (l *ListUserIssuesOptions) GetLabels() []string { + if l == nil || l.Labels == nil { + return nil + } + return l.Labels +} + +// GetSince returns the Since field. +func (l *ListUserIssuesOptions) GetSince() time.Time { + if l == nil { + return time.Time{} + } + return l.Since +} + +// GetSort returns the Sort field. +func (l *ListUserIssuesOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetState returns the State field. +func (l *ListUserIssuesOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + +// GetFilter returns the Filter field. +func (l *ListWorkflowJobsOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetActor returns the Actor field. +func (l *ListWorkflowRunsOptions) GetActor() string { + if l == nil { + return "" + } + return l.Actor +} + +// GetBranch returns the Branch field. +func (l *ListWorkflowRunsOptions) GetBranch() string { + if l == nil { + return "" + } + return l.Branch +} + +// GetCheckSuiteID returns the CheckSuiteID field. +func (l *ListWorkflowRunsOptions) GetCheckSuiteID() int64 { + if l == nil { + return 0 + } + return l.CheckSuiteID +} + +// GetCreated returns the Created field. +func (l *ListWorkflowRunsOptions) GetCreated() string { + if l == nil { + return "" + } + return l.Created +} + +// GetEvent returns the Event field. +func (l *ListWorkflowRunsOptions) GetEvent() string { + if l == nil { + return "" + } + return l.Event +} + +// GetExcludePullRequests returns the ExcludePullRequests field. +func (l *ListWorkflowRunsOptions) GetExcludePullRequests() bool { + if l == nil { + return false + } + return l.ExcludePullRequests +} + +// GetHeadSHA returns the HeadSHA field. +func (l *ListWorkflowRunsOptions) GetHeadSHA() string { + if l == nil { + return "" + } + return l.HeadSHA +} + +// GetStatus returns the Status field. +func (l *ListWorkflowRunsOptions) GetStatus() string { + if l == nil { + return "" + } + return l.Status +} + // GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise. func (l *Location) GetEndColumn() int { if l == nil || l.EndColumn == nil { @@ -14822,6 +20766,14 @@ func (l *LockBranch) GetEnabled() bool { return *l.Enabled } +// GetLockReason returns the LockReason field. +func (l *LockIssueOptions) GetLockReason() string { + if l == nil { + return "" + } + return l.LockReason +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (m *MaintenanceOperationStatus) GetHostname() string { if m == nil || m.Hostname == nil { @@ -14846,6 +20798,22 @@ func (m *MaintenanceOperationStatus) GetUUID() string { return *m.UUID } +// GetEnabled returns the Enabled field. +func (m *MaintenanceOptions) GetEnabled() bool { + if m == nil { + return false + } + return m.Enabled +} + +// GetIPExceptionList returns the IPExceptionList slice if it's non-nil, nil otherwise. +func (m *MaintenanceOptions) GetIPExceptionList() []string { + if m == nil || m.IPExceptionList == nil { + return nil + } + return m.IPExceptionList +} + // GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. func (m *MaintenanceOptions) GetMaintenanceModeMessage() string { if m == nil || m.MaintenanceModeMessage == nil { @@ -14878,6 +20846,14 @@ func (m *MaintenanceStatus) GetCanUnsetMaintenance() bool { return *m.CanUnsetMaintenance } +// GetConnectionServices returns the ConnectionServices slice if it's non-nil, nil otherwise. +func (m *MaintenanceStatus) GetConnectionServices() []*ConnectionServiceItem { + if m == nil || m.ConnectionServices == nil { + return nil + } + return m.ConnectionServices +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (m *MaintenanceStatus) GetHostname() string { if m == nil || m.Hostname == nil { @@ -14886,6 +20862,14 @@ func (m *MaintenanceStatus) GetHostname() string { return *m.Hostname } +// GetIPExceptionList returns the IPExceptionList slice if it's non-nil, nil otherwise. +func (m *MaintenanceStatus) GetIPExceptionList() []string { + if m == nil || m.IPExceptionList == nil { + return nil + } + return m.IPExceptionList +} + // GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. func (m *MaintenanceStatus) GetMaintenanceModeMessage() string { if m == nil || m.MaintenanceModeMessage == nil { @@ -14918,6 +20902,22 @@ func (m *MaintenanceStatus) GetUUID() string { return *m.UUID } +// GetContext returns the Context field. +func (m *MarkdownOptions) GetContext() string { + if m == nil { + return "" + } + return m.Context +} + +// GetMode returns the Mode field. +func (m *MarkdownOptions) GetMode() string { + if m == nil { + return "" + } + return m.Mode +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -15286,6 +21286,14 @@ func (m *MarketplacePurchaseEvent) GetSender() *User { return m.Sender } +// GetIndices returns the Indices slice if it's non-nil, nil otherwise. +func (m *Match) GetIndices() []int { + if m == nil || m.Indices == nil { + return nil + } + return m.Indices +} + // GetText returns the Text field if it's non-nil, zero value otherwise. func (m *Match) GetText() string { if m == nil || m.Text == nil { @@ -15294,6 +21302,38 @@ func (m *Match) GetText() string { return *m.Text } +// GetParameters returns the Parameters field. +func (m *MaxFilePathLengthBranchRule) GetParameters() MaxFilePathLengthRuleParameters { + if m == nil { + return MaxFilePathLengthRuleParameters{} + } + return m.Parameters +} + +// GetMaxFilePathLength returns the MaxFilePathLength field. +func (m *MaxFilePathLengthRuleParameters) GetMaxFilePathLength() int { + if m == nil { + return 0 + } + return m.MaxFilePathLength +} + +// GetParameters returns the Parameters field. +func (m *MaxFileSizeBranchRule) GetParameters() MaxFileSizeRuleParameters { + if m == nil { + return MaxFileSizeRuleParameters{} + } + return m.Parameters +} + +// GetMaxFileSize returns the MaxFileSize field. +func (m *MaxFileSizeRuleParameters) GetMaxFileSize() int64 { + if m == nil { + return 0 + } + return m.MaxFileSize +} + // GetPermission returns the Permission field. func (m *MemberChanges) GetPermission() *MemberChangesPermission { if m == nil { @@ -15598,6 +21638,70 @@ func (m *MergeGroupEvent) GetSender() *User { return m.Sender } +// GetParameters returns the Parameters field. +func (m *MergeQueueBranchRule) GetParameters() MergeQueueRuleParameters { + if m == nil { + return MergeQueueRuleParameters{} + } + return m.Parameters +} + +// GetCheckResponseTimeoutMinutes returns the CheckResponseTimeoutMinutes field. +func (m *MergeQueueRuleParameters) GetCheckResponseTimeoutMinutes() int { + if m == nil { + return 0 + } + return m.CheckResponseTimeoutMinutes +} + +// GetGroupingStrategy returns the GroupingStrategy field. +func (m *MergeQueueRuleParameters) GetGroupingStrategy() MergeGroupingStrategy { + if m == nil { + return "" + } + return m.GroupingStrategy +} + +// GetMaxEntriesToBuild returns the MaxEntriesToBuild field. +func (m *MergeQueueRuleParameters) GetMaxEntriesToBuild() int { + if m == nil { + return 0 + } + return m.MaxEntriesToBuild +} + +// GetMaxEntriesToMerge returns the MaxEntriesToMerge field. +func (m *MergeQueueRuleParameters) GetMaxEntriesToMerge() int { + if m == nil { + return 0 + } + return m.MaxEntriesToMerge +} + +// GetMergeMethod returns the MergeMethod field. +func (m *MergeQueueRuleParameters) GetMergeMethod() MergeQueueMergeMethod { + if m == nil { + return "" + } + return m.MergeMethod +} + +// GetMinEntriesToMerge returns the MinEntriesToMerge field. +func (m *MergeQueueRuleParameters) GetMinEntriesToMerge() int { + if m == nil { + return 0 + } + return m.MinEntriesToMerge +} + +// GetMinEntriesToMergeWaitMinutes returns the MinEntriesToMergeWaitMinutes field. +func (m *MergeQueueRuleParameters) GetMinEntriesToMergeWaitMinutes() int { + if m == nil { + return 0 + } + return m.MinEntriesToMergeWaitMinutes +} + // GetText returns the Text field if it's non-nil, zero value otherwise. func (m *Message) GetText() string { if m == nil || m.Text == nil { @@ -15750,6 +21854,14 @@ func (m *Migration) GetLockRepositories() bool { return *m.LockRepositories } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (m *Migration) GetRepositories() []*Repository { + if m == nil || m.Repositories == nil { + return nil + } + return m.Repositories +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (m *Migration) GetState() string { if m == nil || m.State == nil { @@ -15774,6 +21886,38 @@ func (m *Migration) GetURL() string { return *m.URL } +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (m *MigrationOptions) GetExclude() []string { + if m == nil || m.Exclude == nil { + return nil + } + return m.Exclude +} + +// GetExcludeAttachments returns the ExcludeAttachments field. +func (m *MigrationOptions) GetExcludeAttachments() bool { + if m == nil { + return false + } + return m.ExcludeAttachments +} + +// GetExcludeReleases returns the ExcludeReleases field. +func (m *MigrationOptions) GetExcludeReleases() bool { + if m == nil { + return false + } + return m.ExcludeReleases +} + +// GetLockRepositories returns the LockRepositories field. +func (m *MigrationOptions) GetLockRepositories() bool { + if m == nil { + return false + } + return m.LockRepositories +} + // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. func (m *Milestone) GetClosedAt() Timestamp { if m == nil || m.ClosedAt == nil { @@ -15958,6 +22102,30 @@ func (m *MilestoneEvent) GetSender() *User { return m.Sender } +// GetDirection returns the Direction field. +func (m *MilestoneListOptions) GetDirection() string { + if m == nil { + return "" + } + return m.Direction +} + +// GetSort returns the Sort field. +func (m *MilestoneListOptions) GetSort() string { + if m == nil { + return "" + } + return m.Sort +} + +// GetState returns the State field. +func (m *MilestoneListOptions) GetState() string { + if m == nil { + return "" + } + return m.State +} + // GetClosedMilestones returns the ClosedMilestones field if it's non-nil, zero value otherwise. func (m *MilestoneStats) GetClosedMilestones() int { if m == nil || m.ClosedMilestones == nil { @@ -15998,6 +22166,14 @@ func (m *MostRecentInstance) GetCategory() string { return *m.Category } +// GetClassifications returns the Classifications slice if it's non-nil, nil otherwise. +func (m *MostRecentInstance) GetClassifications() []string { + if m == nil || m.Classifications == nil { + return nil + } + return m.Classifications +} + // GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. func (m *MostRecentInstance) GetCommitSHA() string { if m == nil || m.CommitSHA == nil { @@ -16086,6 +22262,14 @@ func (n *NetworkConfiguration) GetName() string { return *n.Name } +// GetNetworkSettingsIDs returns the NetworkSettingsIDs slice if it's non-nil, nil otherwise. +func (n *NetworkConfiguration) GetNetworkSettingsIDs() []string { + if n == nil || n.NetworkSettingsIDs == nil { + return nil + } + return n.NetworkSettingsIDs +} + // GetComputeService returns the ComputeService field. func (n *NetworkConfigurationRequest) GetComputeService() *ComputeService { if n == nil { @@ -16102,6 +22286,22 @@ func (n *NetworkConfigurationRequest) GetName() string { return *n.Name } +// GetNetworkSettingsIDs returns the NetworkSettingsIDs slice if it's non-nil, nil otherwise. +func (n *NetworkConfigurationRequest) GetNetworkSettingsIDs() []string { + if n == nil || n.NetworkSettingsIDs == nil { + return nil + } + return n.NetworkSettingsIDs +} + +// GetNetworkConfigurations returns the NetworkConfigurations slice if it's non-nil, nil otherwise. +func (n *NetworkConfigurations) GetNetworkConfigurations() []*NetworkConfiguration { + if n == nil || n.NetworkConfigurations == nil { + return nil + } + return n.NetworkConfigurations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (n *NetworkConfigurations) GetTotalCount() int64 { if n == nil || n.TotalCount == nil { @@ -16230,6 +22430,22 @@ func (n *NewTeam) GetLDAPDN() string { return *n.LDAPDN } +// GetMaintainers returns the Maintainers slice if it's non-nil, nil otherwise. +func (n *NewTeam) GetMaintainers() []string { + if n == nil || n.Maintainers == nil { + return nil + } + return n.Maintainers +} + +// GetName returns the Name field. +func (n *NewTeam) GetName() string { + if n == nil { + return "" + } + return n.Name +} + // GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise. func (n *NewTeam) GetNotificationSetting() string { if n == nil || n.NotificationSetting == nil { @@ -16262,6 +22478,22 @@ func (n *NewTeam) GetPrivacy() string { return *n.Privacy } +// GetRepoNames returns the RepoNames slice if it's non-nil, nil otherwise. +func (n *NewTeam) GetRepoNames() []string { + if n == nil || n.RepoNames == nil { + return nil + } + return n.RepoNames +} + +// GetClusterRoles returns the ClusterRoles slice if it's non-nil, nil otherwise. +func (n *NodeDetails) GetClusterRoles() []string { + if n == nil || n.ClusterRoles == nil { + return nil + } + return n.ClusterRoles +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (n *NodeDetails) GetHostname() string { if n == nil || n.Hostname == nil { @@ -16278,6 +22510,14 @@ func (n *NodeDetails) GetUUID() string { return *n.UUID } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (n *NodeMetadataStatus) GetNodes() []*NodeDetails { + if n == nil || n.Nodes == nil { + return nil + } + return n.Nodes +} + // GetTopology returns the Topology field if it's non-nil, zero value otherwise. func (n *NodeMetadataStatus) GetTopology() string { if n == nil || n.Topology == nil { @@ -16382,6 +22622,38 @@ func (n *Notification) GetURL() string { return *n.URL } +// GetAll returns the All field. +func (n *NotificationListOptions) GetAll() bool { + if n == nil { + return false + } + return n.All +} + +// GetBefore returns the Before field. +func (n *NotificationListOptions) GetBefore() time.Time { + if n == nil { + return time.Time{} + } + return n.Before +} + +// GetParticipating returns the Participating field. +func (n *NotificationListOptions) GetParticipating() bool { + if n == nil { + return false + } + return n.Participating +} + +// GetSince returns the Since field. +func (n *NotificationListOptions) GetSince() time.Time { + if n == nil { + return time.Time{} + } + return n.Since +} + // GetLatestCommentURL returns the LatestCommentURL field if it's non-nil, zero value otherwise. func (n *NotificationSubject) GetLatestCommentURL() string { if n == nil || n.LatestCommentURL == nil { @@ -16438,6 +22710,14 @@ func (o *OAuthAPP) GetURL() string { return *o.URL } +// GetIncludeClaimKeys returns the IncludeClaimKeys slice if it's non-nil, nil otherwise. +func (o *OIDCSubjectClaimCustomTemplate) GetIncludeClaimKeys() []string { + if o == nil || o.IncludeClaimKeys == nil { + return nil + } + return o.IncludeClaimKeys +} + // GetUseDefault returns the UseDefault field if it's non-nil, zero value otherwise. func (o *OIDCSubjectClaimCustomTemplate) GetUseDefault() bool { if o == nil || o.UseDefault == nil { @@ -16966,6 +23246,22 @@ func (o *Organization) GetWebCommitSignoffRequired() bool { return *o.WebCommitSignoffRequired } +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (o *OrganizationCustomPropertyValues) GetProperties() []*CustomPropertyValue { + if o == nil || o.Properties == nil { + return nil + } + return o.Properties +} + +// GetCustomRepoRoles returns the CustomRepoRoles slice if it's non-nil, nil otherwise. +func (o *OrganizationCustomRepoRoles) GetCustomRepoRoles() []*CustomRepoRoles { + if o == nil || o.CustomRepoRoles == nil { + return nil + } + return o.CustomRepoRoles +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationCustomRepoRoles) GetTotalCount() int { if o == nil || o.TotalCount == nil { @@ -16974,6 +23270,14 @@ func (o *OrganizationCustomRepoRoles) GetTotalCount() int { return *o.TotalCount } +// GetCustomRepoRoles returns the CustomRepoRoles slice if it's non-nil, nil otherwise. +func (o *OrganizationCustomRoles) GetCustomRepoRoles() []*CustomOrgRole { + if o == nil || o.CustomRepoRoles == nil { + return nil + } + return o.CustomRepoRoles +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationCustomRoles) GetTotalCount() int { if o == nil || o.TotalCount == nil { @@ -17030,6 +23334,30 @@ func (o *OrganizationEvent) GetSender() *User { return o.Sender } +// GetDescription returns the Description field. +func (o *OrganizationFineGrainedPermission) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +// GetName returns the Name field. +func (o *OrganizationFineGrainedPermission) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +// GetInstallations returns the Installations slice if it's non-nil, nil otherwise. +func (o *OrganizationInstallations) GetInstallations() []*Installation { + if o == nil || o.Installations == nil { + return nil + } + return o.Installations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationInstallations) GetTotalCount() int { if o == nil || o.TotalCount == nil { @@ -17038,6 +23366,22 @@ func (o *OrganizationInstallations) GetTotalCount() int { return *o.TotalCount } +// GetPerPage returns the PerPage field. +func (o *OrganizationsListOptions) GetPerPage() int { + if o == nil { + return 0 + } + return o.PerPage +} + +// GetSince returns the Since field. +func (o *OrganizationsListOptions) GetSince() int64 { + if o == nil { + return 0 + } + return o.Since +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (o *OrgBlockEvent) GetAction() string { if o == nil || o.Action == nil { @@ -17254,6 +23598,14 @@ func (p *Package) GetVisibility() string { return *p.Visibility } +// GetTags returns the Tags slice if it's non-nil, nil otherwise. +func (p *PackageContainerMetadata) GetTags() []string { + if p == nil || p.Tags == nil { + return nil + } + return p.Tags +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PackageEvent) GetAction() string { if p == nil || p.Action == nil { @@ -17342,6 +23694,30 @@ func (p *PackageEventContainerMetadataTag) GetName() string { return *p.Name } +// GetReferenceCategory returns the ReferenceCategory field. +func (p *PackageExternalRef) GetReferenceCategory() string { + if p == nil { + return "" + } + return p.ReferenceCategory +} + +// GetReferenceLocator returns the ReferenceLocator field. +func (p *PackageExternalRef) GetReferenceLocator() string { + if p == nil { + return "" + } + return p.ReferenceLocator +} + +// GetReferenceType returns the ReferenceType field. +func (p *PackageExternalRef) GetReferenceType() string { + if p == nil { + return "" + } + return p.ReferenceType +} + // GetAuthor returns the Author field. func (p *PackageFile) GetAuthor() *User { if p == nil { @@ -17510,6 +23886,22 @@ func (p *PackageNPMMetadata) GetCommitOID() string { return *p.CommitOID } +// GetContributors returns the Contributors slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetContributors() []any { + if p == nil || p.Contributors == nil { + return nil + } + return p.Contributors +} + +// GetCPU returns the CPU slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetCPU() []string { + if p == nil || p.CPU == nil { + return nil + } + return p.CPU +} + // GetDeletedByID returns the DeletedByID field if it's non-nil, zero value otherwise. func (p *PackageNPMMetadata) GetDeletedByID() int64 { if p == nil || p.DeletedByID == nil { @@ -17566,6 +23958,14 @@ func (p *PackageNPMMetadata) GetEngines() map[string]string { return p.Engines } +// GetFiles returns the Files slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetFiles() []string { + if p == nil || p.Files == nil { + return nil + } + return p.Files +} + // GetGitHead returns the GitHead field if it's non-nil, zero value otherwise. func (p *PackageNPMMetadata) GetGitHead() string { if p == nil || p.GitHead == nil { @@ -17606,6 +24006,14 @@ func (p *PackageNPMMetadata) GetInstallationCommand() string { return *p.InstallationCommand } +// GetKeywords returns the Keywords slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetKeywords() []string { + if p == nil || p.Keywords == nil { + return nil + } + return p.Keywords +} + // GetLicense returns the License field if it's non-nil, zero value otherwise. func (p *PackageNPMMetadata) GetLicense() string { if p == nil || p.License == nil { @@ -17622,6 +24030,14 @@ func (p *PackageNPMMetadata) GetMain() string { return *p.Main } +// GetMaintainers returns the Maintainers slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetMaintainers() []any { + if p == nil || p.Maintainers == nil { + return nil + } + return p.Maintainers +} + // GetMan returns the Man map if it's non-nil, an empty map otherwise. func (p *PackageNPMMetadata) GetMan() map[string]any { if p == nil || p.Man == nil { @@ -17670,6 +24086,14 @@ func (p *PackageNPMMetadata) GetOptionalDependencies() map[string]string { return p.OptionalDependencies } +// GetOS returns the OS slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetOS() []string { + if p == nil || p.OS == nil { + return nil + } + return p.OS +} + // GetPeerDependencies returns the PeerDependencies map if it's non-nil, an empty map otherwise. func (p *PackageNPMMetadata) GetPeerDependencies() map[string]string { if p == nil || p.PeerDependencies == nil { @@ -17726,6 +24150,14 @@ func (p *PackageNPMMetadata) GetVersion() string { return *p.Version } +// GetID returns the ID field. +func (p *PackageNugetMetadata) GetID() json.RawMessage { + if p == nil { + return json.RawMessage{} + } + return p.ID +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PackageNugetMetadata) GetName() string { if p == nil || p.Name == nil { @@ -17734,6 +24166,14 @@ func (p *PackageNugetMetadata) GetName() string { return *p.Name } +// GetValue returns the Value field. +func (p *PackageNugetMetadata) GetValue() json.RawMessage { + if p == nil { + return json.RawMessage{} + } + return p.Value +} + // GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise. func (p *PackageRegistry) GetAboutURL() string { if p == nil || p.AboutURL == nil { @@ -17862,6 +24302,30 @@ func (p *PackageRelease) GetURL() string { return *p.URL } +// GetIncludedGigabytesBandwidth returns the IncludedGigabytesBandwidth field. +func (p *PackagesBilling) GetIncludedGigabytesBandwidth() int { + if p == nil { + return 0 + } + return p.IncludedGigabytesBandwidth +} + +// GetTotalGigabytesBandwidthUsed returns the TotalGigabytesBandwidthUsed field. +func (p *PackagesBilling) GetTotalGigabytesBandwidthUsed() int { + if p == nil { + return 0 + } + return p.TotalGigabytesBandwidthUsed +} + +// GetTotalPaidGigabytesBandwidthUsed returns the TotalPaidGigabytesBandwidthUsed field. +func (p *PackagesBilling) GetTotalPaidGigabytesBandwidthUsed() int { + if p == nil { + return 0 + } + return p.TotalPaidGigabytesBandwidthUsed +} + // GetAuthor returns the Author field. func (p *PackageVersion) GetAuthor() *User { if p == nil { @@ -17910,6 +24374,14 @@ func (p *PackageVersion) GetDescription() string { return *p.Description } +// GetDockerMetadata returns the DockerMetadata slice if it's non-nil, nil otherwise. +func (p *PackageVersion) GetDockerMetadata() []any { + if p == nil || p.DockerMetadata == nil { + return nil + } + return p.DockerMetadata +} + // GetDraft returns the Draft field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetDraft() bool { if p == nil || p.Draft == nil { @@ -17974,6 +24446,22 @@ func (p *PackageVersion) GetNPMMetadata() *PackageNPMMetadata { return p.NPMMetadata } +// GetNugetMetadata returns the NugetMetadata slice if it's non-nil, nil otherwise. +func (p *PackageVersion) GetNugetMetadata() []*PackageNugetMetadata { + if p == nil || p.NugetMetadata == nil { + return nil + } + return p.NugetMetadata +} + +// GetPackageFiles returns the PackageFiles slice if it's non-nil, nil otherwise. +func (p *PackageVersion) GetPackageFiles() []*PackageFile { + if p == nil || p.PackageFiles == nil { + return nil + } + return p.PackageFiles +} + // GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetPackageHTMLURL() string { if p == nil || p.PackageHTMLURL == nil { @@ -18646,6 +25134,14 @@ func (p *PagesHTTPSCertificate) GetDescription() string { return *p.Description } +// GetDomains returns the Domains slice if it's non-nil, nil otherwise. +func (p *PagesHTTPSCertificate) GetDomains() []string { + if p == nil || p.Domains == nil { + return nil + } + return p.Domains +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (p *PagesHTTPSCertificate) GetExpiresAt() string { if p == nil || p.ExpiresAt == nil { @@ -18758,6 +25254,14 @@ func (p *PagesUpdateWithoutCNAME) GetSource() *PagesSource { return p.Source } +// GetParameters returns the Parameters field. +func (p *PatternBranchRule) GetParameters() PatternRuleParameters { + if p == nil { + return PatternRuleParameters{} + } + return p.Parameters +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PatternRuleParameters) GetName() string { if p == nil || p.Name == nil { @@ -18774,6 +25278,22 @@ func (p *PatternRuleParameters) GetNegate() bool { return *p.Negate } +// GetOperator returns the Operator field. +func (p *PatternRuleParameters) GetOperator() PatternRuleOperator { + if p == nil { + return "" + } + return p.Operator +} + +// GetPattern returns the Pattern field. +func (p *PatternRuleParameters) GetPattern() string { + if p == nil { + return "" + } + return p.Pattern +} + // GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise. func (p *PendingDeployment) GetCurrentUserCanApprove() bool { if p == nil || p.CurrentUserCanApprove == nil { @@ -18790,6 +25310,14 @@ func (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment { return p.Environment } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (p *PendingDeployment) GetReviewers() []*RequiredReviewer { + if p == nil || p.Reviewers == nil { + return nil + } + return p.Reviewers +} + // GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. func (p *PendingDeployment) GetWaitTimer() int64 { if p == nil || p.WaitTimer == nil { @@ -18846,6 +25374,30 @@ func (p *PendingDeploymentEnvironment) GetURL() string { return *p.URL } +// GetComment returns the Comment field. +func (p *PendingDeploymentsRequest) GetComment() string { + if p == nil { + return "" + } + return p.Comment +} + +// GetEnvironmentIDs returns the EnvironmentIDs slice if it's non-nil, nil otherwise. +func (p *PendingDeploymentsRequest) GetEnvironmentIDs() []int64 { + if p == nil || p.EnvironmentIDs == nil { + return nil + } + return p.EnvironmentIDs +} + +// GetState returns the State field. +func (p *PendingDeploymentsRequest) GetState() string { + if p == nil { + return "" + } + return p.State +} + // GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise. func (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp { if p == nil || p.AccessGrantedAt == nil { @@ -19014,6 +25566,14 @@ func (p *PersonalAccessTokenRequest) GetPermissionsUpgraded() *PersonalAccessTok return p.PermissionsUpgraded } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (p *PersonalAccessTokenRequest) GetRepositories() []*Repository { + if p == nil || p.Repositories == nil { + return nil + } + return p.Repositories +} + // GetRepositoryCount returns the RepositoryCount field if it's non-nil, zero value otherwise. func (p *PersonalAccessTokenRequest) GetRepositoryCount() int64 { if p == nil || p.RepositoryCount == nil { @@ -19198,6 +25758,102 @@ func (p *Plan) GetSpace() int { return *p.Space } +// GetAutoTriggerChecks returns the AutoTriggerChecks slice if it's non-nil, nil otherwise. +func (p *PreferenceList) GetAutoTriggerChecks() []*AutoTriggerCheck { + if p == nil || p.AutoTriggerChecks == nil { + return nil + } + return p.AutoTriggerChecks +} + +// GetDiscountAmount returns the DiscountAmount field. +func (p *PremiumRequestUsageItem) GetDiscountAmount() float64 { + if p == nil { + return 0 + } + return p.DiscountAmount +} + +// GetDiscountQuantity returns the DiscountQuantity field. +func (p *PremiumRequestUsageItem) GetDiscountQuantity() float64 { + if p == nil { + return 0 + } + return p.DiscountQuantity +} + +// GetGrossAmount returns the GrossAmount field. +func (p *PremiumRequestUsageItem) GetGrossAmount() float64 { + if p == nil { + return 0 + } + return p.GrossAmount +} + +// GetGrossQuantity returns the GrossQuantity field. +func (p *PremiumRequestUsageItem) GetGrossQuantity() float64 { + if p == nil { + return 0 + } + return p.GrossQuantity +} + +// GetModel returns the Model field. +func (p *PremiumRequestUsageItem) GetModel() string { + if p == nil { + return "" + } + return p.Model +} + +// GetNetAmount returns the NetAmount field. +func (p *PremiumRequestUsageItem) GetNetAmount() float64 { + if p == nil { + return 0 + } + return p.NetAmount +} + +// GetNetQuantity returns the NetQuantity field. +func (p *PremiumRequestUsageItem) GetNetQuantity() float64 { + if p == nil { + return 0 + } + return p.NetQuantity +} + +// GetPricePerUnit returns the PricePerUnit field. +func (p *PremiumRequestUsageItem) GetPricePerUnit() float64 { + if p == nil { + return 0 + } + return p.PricePerUnit +} + +// GetProduct returns the Product field. +func (p *PremiumRequestUsageItem) GetProduct() string { + if p == nil { + return "" + } + return p.Product +} + +// GetSKU returns the SKU field. +func (p *PremiumRequestUsageItem) GetSKU() string { + if p == nil { + return "" + } + return p.SKU +} + +// GetUnitType returns the UnitType field. +func (p *PremiumRequestUsageItem) GetUnitType() string { + if p == nil { + return "" + } + return p.UnitType +} + // GetModel returns the Model field if it's non-nil, zero value otherwise. func (p *PremiumRequestUsageReport) GetModel() string { if p == nil || p.Model == nil { @@ -19222,6 +25878,22 @@ func (p *PremiumRequestUsageReport) GetProduct() string { return *p.Product } +// GetTimePeriod returns the TimePeriod field. +func (p *PremiumRequestUsageReport) GetTimePeriod() PremiumRequestUsageTimePeriod { + if p == nil { + return PremiumRequestUsageTimePeriod{} + } + return p.TimePeriod +} + +// GetUsageItems returns the UsageItems slice if it's non-nil, nil otherwise. +func (p *PremiumRequestUsageReport) GetUsageItems() []*PremiumRequestUsageItem { + if p == nil || p.UsageItems == nil { + return nil + } + return p.UsageItems +} + // GetUser returns the User field if it's non-nil, zero value otherwise. func (p *PremiumRequestUsageReport) GetUser() string { if p == nil || p.User == nil { @@ -19294,6 +25966,14 @@ func (p *PremiumRequestUsageTimePeriod) GetMonth() int { return *p.Month } +// GetYear returns the Year field. +func (p *PremiumRequestUsageTimePeriod) GetYear() int { + if p == nil { + return 0 + } + return p.Year +} + // GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise. func (p *PreReceiveHook) GetConfigURL() string { if p == nil || p.ConfigURL == nil { @@ -19326,6 +26006,14 @@ func (p *PreReceiveHook) GetName() string { return *p.Name } +// GetConfigurations returns the Configurations slice if it's non-nil, nil otherwise. +func (p *PrivateRegistries) GetConfigurations() []*PrivateRegistry { + if p == nil || p.Configurations == nil { + return nil + } + return p.Configurations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (p *PrivateRegistries) GetTotalCount() int { if p == nil || p.TotalCount == nil { @@ -19862,6 +26550,14 @@ func (p *ProjectV2Field) GetNodeID() string { return *p.NodeID } +// GetOptions returns the Options slice if it's non-nil, nil otherwise. +func (p *ProjectV2Field) GetOptions() []*ProjectV2FieldOption { + if p == nil || p.Options == nil { + return nil + } + return p.Options +} + // GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise. func (p *ProjectV2Field) GetProjectURL() string { if p == nil || p.ProjectURL == nil { @@ -19886,6 +26582,14 @@ func (p *ProjectV2FieldConfiguration) GetDuration() int { return *p.Duration } +// GetIterations returns the Iterations slice if it's non-nil, nil otherwise. +func (p *ProjectV2FieldConfiguration) GetIterations() []*ProjectV2FieldIteration { + if p == nil || p.Iterations == nil { + return nil + } + return p.Iterations +} + // GetStartDay returns the StartDay field if it's non-nil, zero value otherwise. func (p *ProjectV2FieldConfiguration) GetStartDay() int { if p == nil || p.StartDay == nil { @@ -20006,6 +26710,14 @@ func (p *ProjectV2Item) GetCreator() *User { return p.Creator } +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (p *ProjectV2Item) GetFields() []*ProjectV2ItemFieldValue { + if p == nil || p.Fields == nil { + return nil + } + return p.Fields +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (p *ProjectV2Item) GetID() int64 { if p == nil || p.ID == nil { @@ -20166,6 +26878,14 @@ func (p *ProjectV2ItemFieldValue) GetName() string { return *p.Name } +// GetValue returns the Value field. +func (p *ProjectV2ItemFieldValue) GetValue() any { + if p == nil { + return nil + } + return p.Value +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (p *ProjectV2StatusUpdate) GetBody() string { if p == nil || p.Body == nil { @@ -20526,6 +27246,14 @@ func (p *ProtectionRequest) GetBlockCreations() bool { return *p.BlockCreations } +// GetEnforceAdmins returns the EnforceAdmins field. +func (p *ProtectionRequest) GetEnforceAdmins() bool { + if p == nil { + return false + } + return p.EnforceAdmins +} + // GetLockBranch returns the LockBranch field if it's non-nil, zero value otherwise. func (p *ProtectionRequest) GetLockBranch() bool { if p == nil || p.LockBranch == nil { @@ -20598,6 +27326,14 @@ func (p *ProtectionRule) GetPreventSelfReview() bool { return *p.PreventSelfReview } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (p *ProtectionRule) GetReviewers() []*RequiredReviewer { + if p == nil || p.Reviewers == nil { + return nil + } + return p.Reviewers +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (p *ProtectionRule) GetType() string { if p == nil || p.Type == nil { @@ -20646,6 +27382,22 @@ func (p *PublicEvent) GetSender() *User { return p.Sender } +// GetCurrentUsage returns the CurrentUsage field. +func (p *PublicIPUsage) GetCurrentUsage() int64 { + if p == nil { + return 0 + } + return p.CurrentUsage +} + +// GetMaximum returns the Maximum field. +func (p *PublicIPUsage) GetMaximum() int64 { + if p == nil { + return 0 + } + return p.Maximum +} + // GetKey returns the Key field if it's non-nil, zero value otherwise. func (p *PublicKey) GetKey() string { if p == nil || p.Key == nil { @@ -20702,6 +27454,14 @@ func (p *PullRequest) GetAssignee() *User { return p.Assignee } +// GetAssignees returns the Assignees slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetAssignees() []*User { + if p == nil || p.Assignees == nil { + return nil + } + return p.Assignees +} + // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. func (p *PullRequest) GetAuthorAssociation() string { if p == nil || p.AuthorAssociation == nil { @@ -20846,6 +27606,14 @@ func (p *PullRequest) GetIssueURL() string { return *p.IssueURL } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetLabels() []*Label { + if p == nil || p.Labels == nil { + return nil + } + return p.Labels +} + // GetLinks returns the Links field. func (p *PullRequest) GetLinks() *PRLinks { if p == nil { @@ -20958,6 +27726,22 @@ func (p *PullRequest) GetRebaseable() bool { return *p.Rebaseable } +// GetRequestedReviewers returns the RequestedReviewers slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetRequestedReviewers() []*User { + if p == nil || p.RequestedReviewers == nil { + return nil + } + return p.RequestedReviewers +} + +// GetRequestedTeams returns the RequestedTeams slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetRequestedTeams() []*Team { + if p == nil || p.RequestedTeams == nil { + return nil + } + return p.RequestedTeams +} + // GetReviewComments returns the ReviewComments field if it's non-nil, zero value otherwise. func (p *PullRequest) GetReviewComments() int { if p == nil || p.ReviewComments == nil { @@ -21102,6 +27886,14 @@ func (p *PullRequestBranch) GetUser() *User { return p.User } +// GetParameters returns the Parameters field. +func (p *PullRequestBranchRule) GetParameters() PullRequestRuleParameters { + if p == nil { + return PullRequestRuleParameters{} + } + return p.Parameters +} + // GetExpectedHeadSHA returns the ExpectedHeadSHA field if it's non-nil, zero value otherwise. func (p *PullRequestBranchUpdateOptions) GetExpectedHeadSHA() string { if p == nil || p.ExpectedHeadSHA == nil { @@ -21502,6 +28294,70 @@ func (p *PullRequestLinks) GetURL() string { return *p.URL } +// GetDirection returns the Direction field. +func (p *PullRequestListCommentsOptions) GetDirection() string { + if p == nil { + return "" + } + return p.Direction +} + +// GetSince returns the Since field. +func (p *PullRequestListCommentsOptions) GetSince() time.Time { + if p == nil { + return time.Time{} + } + return p.Since +} + +// GetSort returns the Sort field. +func (p *PullRequestListCommentsOptions) GetSort() string { + if p == nil { + return "" + } + return p.Sort +} + +// GetBase returns the Base field. +func (p *PullRequestListOptions) GetBase() string { + if p == nil { + return "" + } + return p.Base +} + +// GetDirection returns the Direction field. +func (p *PullRequestListOptions) GetDirection() string { + if p == nil { + return "" + } + return p.Direction +} + +// GetHead returns the Head field. +func (p *PullRequestListOptions) GetHead() string { + if p == nil { + return "" + } + return p.Head +} + +// GetSort returns the Sort field. +func (p *PullRequestListOptions) GetSort() string { + if p == nil { + return "" + } + return p.Sort +} + +// GetState returns the State field. +func (p *PullRequestListOptions) GetState() string { + if p == nil { + return "" + } + return p.State +} + // GetMerged returns the Merged field if it's non-nil, zero value otherwise. func (p *PullRequestMergeResult) GetMerged() bool { if p == nil || p.Merged == nil { @@ -21526,6 +28382,38 @@ func (p *PullRequestMergeResult) GetSHA() string { return *p.SHA } +// GetCommitTitle returns the CommitTitle field. +func (p *PullRequestOptions) GetCommitTitle() string { + if p == nil { + return "" + } + return p.CommitTitle +} + +// GetDontDefaultIfBlank returns the DontDefaultIfBlank field. +func (p *PullRequestOptions) GetDontDefaultIfBlank() bool { + if p == nil { + return false + } + return p.DontDefaultIfBlank +} + +// GetMergeMethod returns the MergeMethod field. +func (p *PullRequestOptions) GetMergeMethod() string { + if p == nil { + return "" + } + return p.MergeMethod +} + +// GetSHA returns the SHA field. +func (p *PullRequestOptions) GetSHA() string { + if p == nil { + return "" + } + return p.SHA +} + // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. func (p *PullRequestReview) GetAuthorAssociation() string { if p == nil || p.AuthorAssociation == nil { @@ -21742,6 +28630,14 @@ func (p *PullRequestReviewRequest) GetBody() string { return *p.Body } +// GetComments returns the Comments slice if it's non-nil, nil otherwise. +func (p *PullRequestReviewRequest) GetComments() []*DraftReviewComment { + if p == nil || p.Comments == nil { + return nil + } + return p.Comments +} + // GetCommitID returns the CommitID field if it's non-nil, zero value otherwise. func (p *PullRequestReviewRequest) GetCommitID() string { if p == nil || p.CommitID == nil { @@ -21782,6 +28678,38 @@ func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRes return p.DismissalRestrictions } +// GetDismissStaleReviews returns the DismissStaleReviews field. +func (p *PullRequestReviewsEnforcement) GetDismissStaleReviews() bool { + if p == nil { + return false + } + return p.DismissStaleReviews +} + +// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field. +func (p *PullRequestReviewsEnforcement) GetRequireCodeOwnerReviews() bool { + if p == nil { + return false + } + return p.RequireCodeOwnerReviews +} + +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestReviewsEnforcement) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + +// GetRequireLastPushApproval returns the RequireLastPushApproval field. +func (p *PullRequestReviewsEnforcement) GetRequireLastPushApproval() bool { + if p == nil { + return false + } + return p.RequireLastPushApproval +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (p *PullRequestReviewsEnforcementLevelChanges) GetFrom() string { if p == nil || p.From == nil { @@ -21806,6 +28734,30 @@ func (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest() return p.DismissalRestrictionsRequest } +// GetDismissStaleReviews returns the DismissStaleReviews field. +func (p *PullRequestReviewsEnforcementRequest) GetDismissStaleReviews() bool { + if p == nil { + return false + } + return p.DismissStaleReviews +} + +// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field. +func (p *PullRequestReviewsEnforcementRequest) GetRequireCodeOwnerReviews() bool { + if p == nil { + return false + } + return p.RequireCodeOwnerReviews +} + +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestReviewsEnforcementRequest) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + // GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. func (p *PullRequestReviewsEnforcementRequest) GetRequireLastPushApproval() bool { if p == nil || p.RequireLastPushApproval == nil { @@ -21846,6 +28798,14 @@ func (p *PullRequestReviewsEnforcementUpdate) GetRequireCodeOwnerReviews() bool return *p.RequireCodeOwnerReviews } +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestReviewsEnforcementUpdate) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + // GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. func (p *PullRequestReviewsEnforcementUpdate) GetRequireLastPushApproval() bool { if p == nil || p.RequireLastPushApproval == nil { @@ -21910,6 +28870,62 @@ func (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread { return p.Thread } +// GetAllowedMergeMethods returns the AllowedMergeMethods slice if it's non-nil, nil otherwise. +func (p *PullRequestRuleParameters) GetAllowedMergeMethods() []PullRequestMergeMethod { + if p == nil || p.AllowedMergeMethods == nil { + return nil + } + return p.AllowedMergeMethods +} + +// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field. +func (p *PullRequestRuleParameters) GetDismissStaleReviewsOnPush() bool { + if p == nil { + return false + } + return p.DismissStaleReviewsOnPush +} + +// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field. +func (p *PullRequestRuleParameters) GetRequireCodeOwnerReview() bool { + if p == nil { + return false + } + return p.RequireCodeOwnerReview +} + +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestRuleParameters) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + +// GetRequiredReviewers returns the RequiredReviewers slice if it's non-nil, nil otherwise. +func (p *PullRequestRuleParameters) GetRequiredReviewers() []*RulesetRequiredReviewer { + if p == nil || p.RequiredReviewers == nil { + return nil + } + return p.RequiredReviewers +} + +// GetRequiredReviewThreadResolution returns the RequiredReviewThreadResolution field. +func (p *PullRequestRuleParameters) GetRequiredReviewThreadResolution() bool { + if p == nil { + return false + } + return p.RequiredReviewThreadResolution +} + +// GetRequireLastPushApproval returns the RequireLastPushApproval field. +func (p *PullRequestRuleParameters) GetRequireLastPushApproval() bool { + if p == nil { + return false + } + return p.RequireLastPushApproval +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PullRequestTargetEvent) GetAction() string { if p == nil || p.Action == nil { @@ -22030,6 +29046,14 @@ func (p *PullRequestTargetEvent) GetSender() *User { return p.Sender } +// GetComments returns the Comments slice if it's non-nil, nil otherwise. +func (p *PullRequestThread) GetComments() []*PullRequestComment { + if p == nil || p.Comments == nil { + return nil + } + return p.Comments +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (p *PullRequestThread) GetID() int64 { if p == nil || p.ID == nil { @@ -22550,6 +29574,14 @@ func (p *PushEventRepository) GetSVNURL() string { return *p.SVNURL } +// GetTopics returns the Topics slice if it's non-nil, nil otherwise. +func (p *PushEventRepository) GetTopics() []string { + if p == nil || p.Topics == nil { + return nil + } + return p.Topics +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { @@ -22582,6 +29614,94 @@ func (p *PushProtectionBypass) GetExpireAt() Timestamp { return *p.ExpireAt } +// GetReason returns the Reason field. +func (p *PushProtectionBypass) GetReason() string { + if p == nil { + return "" + } + return p.Reason +} + +// GetTokenType returns the TokenType field. +func (p *PushProtectionBypass) GetTokenType() string { + if p == nil { + return "" + } + return p.TokenType +} + +// GetPlaceholderID returns the PlaceholderID field. +func (p *PushProtectionBypassRequest) GetPlaceholderID() string { + if p == nil { + return "" + } + return p.PlaceholderID +} + +// GetReason returns the Reason field. +func (p *PushProtectionBypassRequest) GetReason() string { + if p == nil { + return "" + } + return p.Reason +} + +// GetLimit returns the Limit field. +func (r *Rate) GetLimit() int { + if r == nil { + return 0 + } + return r.Limit +} + +// GetRemaining returns the Remaining field. +func (r *Rate) GetRemaining() int { + if r == nil { + return 0 + } + return r.Remaining +} + +// GetReset returns the Reset field. +func (r *Rate) GetReset() Timestamp { + if r == nil { + return Timestamp{} + } + return r.Reset +} + +// GetResource returns the Resource field. +func (r *Rate) GetResource() string { + if r == nil { + return "" + } + return r.Resource +} + +// GetUsed returns the Used field. +func (r *Rate) GetUsed() int { + if r == nil { + return 0 + } + return r.Used +} + +// GetMessage returns the Message field. +func (r *RateLimitError) GetMessage() string { + if r == nil { + return "" + } + return r.Message +} + +// GetRate returns the Rate field. +func (r *RateLimitError) GetRate() Rate { + if r == nil { + return Rate{} + } + return r.Rate +} + // GetActionsRunnerRegistration returns the ActionsRunnerRegistration field. func (r *RateLimits) GetActionsRunnerRegistration() *Rate { if r == nil { @@ -22678,6 +29798,14 @@ func (r *RateLimits) GetSourceImport() *Rate { return r.SourceImport } +// GetType returns the Type field. +func (r *RawOptions) GetType() RawType { + if r == nil { + return 0 + } + return r.Type +} + // GetContent returns the Content field if it's non-nil, zero value otherwise. func (r *Reaction) GetContent() string { if r == nil || r.Content == nil { @@ -22822,6 +29950,14 @@ func (r *ReassignedResource) GetResourceType() string { return *r.ResourceType } +// GetStatusCode returns the StatusCode field. +func (r *RedirectionError) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *Reference) GetNodeID() string { if r == nil || r.NodeID == nil { @@ -23238,6 +30374,38 @@ func (r *RepoAdvisoryCreditDetailed) GetUser() *User { return r.User } +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (r *RepoCustomPropertyValue) GetProperties() []*CustomPropertyValue { + if r == nil || r.Properties == nil { + return nil + } + return r.Properties +} + +// GetRepositoryFullName returns the RepositoryFullName field. +func (r *RepoCustomPropertyValue) GetRepositoryFullName() string { + if r == nil { + return "" + } + return r.RepositoryFullName +} + +// GetRepositoryID returns the RepositoryID field. +func (r *RepoCustomPropertyValue) GetRepositoryID() int64 { + if r == nil { + return 0 + } + return r.RepositoryID +} + +// GetRepositoryName returns the RepositoryName field. +func (r *RepoCustomPropertyValue) GetRepositoryName() string { + if r == nil { + return "" + } + return r.RepositoryName +} + // GetDownloadLocation returns the DownloadLocation field if it's non-nil, zero value otherwise. func (r *RepoDependencies) GetDownloadLocation() string { if r == nil || r.DownloadLocation == nil { @@ -23246,6 +30414,14 @@ func (r *RepoDependencies) GetDownloadLocation() string { return *r.DownloadLocation } +// GetExternalRefs returns the ExternalRefs slice if it's non-nil, nil otherwise. +func (r *RepoDependencies) GetExternalRefs() []*PackageExternalRef { + if r == nil || r.ExternalRefs == nil { + return nil + } + return r.ExternalRefs +} + // GetFilesAnalyzed returns the FilesAnalyzed field if it's non-nil, zero value otherwise. func (r *RepoDependencies) GetFilesAnalyzed() bool { if r == nil || r.FilesAnalyzed == nil { @@ -23294,6 +30470,38 @@ func (r *RepoDependencies) GetVersionInfo() string { return *r.VersionInfo } +// GetDescription returns the Description field. +func (r *RepoFineGrainedPermission) GetDescription() string { + if r == nil { + return "" + } + return r.Description +} + +// GetName returns the Name field. +func (r *RepoFineGrainedPermission) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (r *RepoImmutableReleasesStatus) GetEnabled() bool { + if r == nil || r.Enabled == nil { + return false + } + return *r.Enabled +} + +// GetEnforcedByOwner returns the EnforcedByOwner field if it's non-nil, zero value otherwise. +func (r *RepoImmutableReleasesStatus) GetEnforcedByOwner() bool { + if r == nil || r.EnforcedByOwner == nil { + return false + } + return *r.EnforcedByOwner +} + // GetBranch returns the Branch field if it's non-nil, zero value otherwise. func (r *RepoMergeUpstreamRequest) GetBranch() string { if r == nil || r.Branch == nil { @@ -23342,6 +30550,14 @@ func (r *RepositoriesSearchResult) GetIncompleteResults() bool { return *r.IncompleteResults } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (r *RepositoriesSearchResult) GetRepositories() []*Repository { + if r == nil || r.Repositories == nil { + return nil + } + return r.Repositories +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetTotal() int { if r == nil || r.Total == nil { @@ -24118,6 +31334,22 @@ func (r *Repository) GetTemplateRepository() *Repository { return r.TemplateRepository } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (r *Repository) GetTextMatches() []*TextMatch { + if r == nil || r.TextMatches == nil { + return nil + } + return r.TextMatches +} + +// GetTopics returns the Topics slice if it's non-nil, nil otherwise. +func (r *Repository) GetTopics() []string { + if r == nil || r.Topics == nil { + return nil + } + return r.Topics +} + // GetTreesURL returns the TreesURL field if it's non-nil, zero value otherwise. func (r *Repository) GetTreesURL() string { if r == nil || r.TreesURL == nil { @@ -24190,6 +31422,38 @@ func (r *RepositoryActionsAccessLevel) GetAccessLevel() string { return *r.AccessLevel } +// GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field. +func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int { + if r == nil { + return 0 + } + return r.AdvancedSecurityCommitters +} + +// GetAdvancedSecurityCommittersBreakdown returns the AdvancedSecurityCommittersBreakdown slice if it's non-nil, nil otherwise. +func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommittersBreakdown() []*AdvancedSecurityCommittersBreakdown { + if r == nil || r.AdvancedSecurityCommittersBreakdown == nil { + return nil + } + return r.AdvancedSecurityCommittersBreakdown +} + +// GetName returns the Name field. +func (r *RepositoryActiveCommitters) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetActivityType returns the ActivityType field. +func (r *RepositoryActivity) GetActivityType() string { + if r == nil { + return "" + } + return r.ActivityType +} + // GetActor returns the Actor field. func (r *RepositoryActivity) GetActor() *RepositoryActor { if r == nil { @@ -24198,6 +31462,46 @@ func (r *RepositoryActivity) GetActor() *RepositoryActor { return r.Actor } +// GetAfter returns the After field. +func (r *RepositoryActivity) GetAfter() string { + if r == nil { + return "" + } + return r.After +} + +// GetBefore returns the Before field. +func (r *RepositoryActivity) GetBefore() string { + if r == nil { + return "" + } + return r.Before +} + +// GetID returns the ID field. +func (r *RepositoryActivity) GetID() int64 { + if r == nil { + return 0 + } + return r.ID +} + +// GetNodeID returns the NodeID field. +func (r *RepositoryActivity) GetNodeID() string { + if r == nil { + return "" + } + return r.NodeID +} + +// GetRef returns the Ref field. +func (r *RepositoryActivity) GetRef() string { + if r == nil { + return "" + } + return r.Ref +} + // GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. func (r *RepositoryActivity) GetTimestamp() Timestamp { if r == nil || r.Timestamp == nil { @@ -24358,6 +31662,14 @@ func (r *RepositoryActor) GetUserViewType() string { return *r.UserViewType } +// GetPermission returns the Permission field. +func (r *RepositoryAddCollaboratorOptions) GetPermission() string { + if r == nil { + return "" + } + return r.Permission +} + // GetRepository returns the Repository field. func (r *RepositoryAttachment) GetRepository() *Repository { if r == nil { @@ -24518,6 +31830,14 @@ func (r *RepositoryCommit) GetCommitter() *User { return r.Committer } +// GetFiles returns the Files slice if it's non-nil, nil otherwise. +func (r *RepositoryCommit) GetFiles() []*CommitFile { + if r == nil || r.Files == nil { + return nil + } + return r.Files +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (r *RepositoryCommit) GetHTMLURL() string { if r == nil || r.HTMLURL == nil { @@ -24534,6 +31854,14 @@ func (r *RepositoryCommit) GetNodeID() string { return *r.NodeID } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (r *RepositoryCommit) GetParents() []*Commit { + if r == nil || r.Parents == nil { + return nil + } + return r.Parents +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (r *RepositoryCommit) GetSHA() string { if r == nil || r.SHA == nil { @@ -24678,6 +32006,14 @@ func (r *RepositoryContentFileOptions) GetCommitter() *CommitAuthor { return r.Committer } +// GetContent returns the Content slice if it's non-nil, nil otherwise. +func (r *RepositoryContentFileOptions) GetContent() []byte { + if r == nil || r.Content == nil { + return nil + } + return r.Content +} + // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (r *RepositoryContentFileOptions) GetMessage() string { if r == nil || r.Message == nil { @@ -24694,6 +32030,14 @@ func (r *RepositoryContentFileOptions) GetSHA() string { return *r.SHA } +// GetRef returns the Ref field. +func (r *RepositoryContentGetOptions) GetRef() string { + if r == nil { + return "" + } + return r.Ref +} + // GetContent returns the Content field. func (r *RepositoryContentResponse) GetContent() *RepositoryContent { if r == nil { @@ -24702,6 +32046,30 @@ func (r *RepositoryContentResponse) GetContent() *RepositoryContent { return r.Content } +// GetDefaultBranchOnly returns the DefaultBranchOnly field. +func (r *RepositoryCreateForkOptions) GetDefaultBranchOnly() bool { + if r == nil { + return false + } + return r.DefaultBranchOnly +} + +// GetName returns the Name field. +func (r *RepositoryCreateForkOptions) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetOrganization returns the Organization field. +func (r *RepositoryCreateForkOptions) GetOrganization() string { + if r == nil { + return "" + } + return r.Organization +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (r *RepositoryDispatchEvent) GetAction() string { if r == nil || r.Action == nil { @@ -24718,6 +32086,14 @@ func (r *RepositoryDispatchEvent) GetBranch() string { return *r.Branch } +// GetClientPayload returns the ClientPayload field. +func (r *RepositoryDispatchEvent) GetClientPayload() json.RawMessage { + if r == nil { + return json.RawMessage{} + } + return r.ClientPayload +} + // GetInstallation returns the Installation field. func (r *RepositoryDispatchEvent) GetInstallation() *Installation { if r == nil { @@ -24998,6 +32374,150 @@ func (r *RepositoryLicense) GetURL() string { return *r.URL } +// GetSince returns the Since field. +func (r *RepositoryListAllOptions) GetSince() int64 { + if r == nil { + return 0 + } + return r.Since +} + +// GetAffiliation returns the Affiliation field. +func (r *RepositoryListByAuthenticatedUserOptions) GetAffiliation() string { + if r == nil { + return "" + } + return r.Affiliation +} + +// GetDirection returns the Direction field. +func (r *RepositoryListByAuthenticatedUserOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListByAuthenticatedUserOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListByAuthenticatedUserOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetVisibility returns the Visibility field. +func (r *RepositoryListByAuthenticatedUserOptions) GetVisibility() string { + if r == nil { + return "" + } + return r.Visibility +} + +// GetDirection returns the Direction field. +func (r *RepositoryListByOrgOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListByOrgOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListByOrgOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetDirection returns the Direction field. +func (r *RepositoryListByUserOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListByUserOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListByUserOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetSort returns the Sort field. +func (r *RepositoryListForksOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetAffiliation returns the Affiliation field. +func (r *RepositoryListOptions) GetAffiliation() string { + if r == nil { + return "" + } + return r.Affiliation +} + +// GetDirection returns the Direction field. +func (r *RepositoryListOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetVisibility returns the Visibility field. +func (r *RepositoryListOptions) GetVisibility() string { + if r == nil { + return "" + } + return r.Visibility +} + // GetIncludesParents returns the IncludesParents field if it's non-nil, zero value otherwise. func (r *RepositoryListRulesetsOptions) GetIncludesParents() bool { if r == nil || r.IncludesParents == nil { @@ -25030,6 +32550,22 @@ func (r *RepositoryMergeRequest) GetHead() string { return *r.Head } +// GetAll returns the All slice if it's non-nil, nil otherwise. +func (r *RepositoryParticipation) GetAll() []int { + if r == nil || r.All == nil { + return nil + } + return r.All +} + +// GetOwner returns the Owner slice if it's non-nil, nil otherwise. +func (r *RepositoryParticipation) GetOwner() []int { + if r == nil || r.Owner == nil { + return nil + } + return r.Owner +} + // GetPermission returns the Permission field if it's non-nil, zero value otherwise. func (r *RepositoryPermissionLevel) GetPermission() string { if r == nil || r.Permission == nil { @@ -25094,6 +32630,14 @@ func (r *RepositoryPermissions) GetTriage() bool { return *r.Triage } +// GetAssets returns the Assets slice if it's non-nil, nil otherwise. +func (r *RepositoryRelease) GetAssets() []*ReleaseAsset { + if r == nil || r.Assets == nil { + return nil + } + return r.Assets +} + // GetAssetsURL returns the AssetsURL field if it's non-nil, zero value otherwise. func (r *RepositoryRelease) GetAssetsURL() string { if r == nil || r.AssetsURL == nil { @@ -25262,6 +32806,46 @@ func (r *RepositoryRelease) GetZipballURL() string { return *r.ZipballURL } +// GetBody returns the Body field. +func (r *RepositoryReleaseNotes) GetBody() string { + if r == nil { + return "" + } + return r.Body +} + +// GetName returns the Name field. +func (r *RepositoryReleaseNotes) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRule) GetParameters() any { + if r == nil { + return nil + } + return r.Parameters +} + +// GetType returns the Type field. +func (r *RepositoryRule) GetType() RepositoryRuleType { + if r == nil { + return "" + } + return r.Type +} + +// GetBypassActors returns the BypassActors slice if it's non-nil, nil otherwise. +func (r *RepositoryRuleset) GetBypassActors() []*BypassActor { + if r == nil || r.BypassActors == nil { + return nil + } + return r.BypassActors +} + // GetConditions returns the Conditions field. func (r *RepositoryRuleset) GetConditions() *RepositoryRulesetConditions { if r == nil { @@ -25286,6 +32870,14 @@ func (r *RepositoryRuleset) GetCurrentUserCanBypass() *BypassMode { return r.CurrentUserCanBypass } +// GetEnforcement returns the Enforcement field. +func (r *RepositoryRuleset) GetEnforcement() RulesetEnforcement { + if r == nil { + return "" + } + return r.Enforcement +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *RepositoryRuleset) GetID() int64 { if r == nil || r.ID == nil { @@ -25302,6 +32894,14 @@ func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLinks { return r.Links } +// GetName returns the Name field. +func (r *RepositoryRuleset) GetName() string { + if r == nil { + return "" + } + return r.Name +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *RepositoryRuleset) GetNodeID() string { if r == nil || r.NodeID == nil { @@ -25318,6 +32918,14 @@ func (r *RepositoryRuleset) GetRules() *RepositoryRulesetRules { return r.Rules } +// GetSource returns the Source field. +func (r *RepositoryRuleset) GetSource() string { + if r == nil { + return "" + } + return r.Source +} + // GetSourceType returns the SourceType field. func (r *RepositoryRuleset) GetSourceType() *RulesetSourceType { if r == nil { @@ -25342,6 +32950,30 @@ func (r *RepositoryRuleset) GetUpdatedAt() Timestamp { return *r.UpdatedAt } +// GetAdded returns the Added slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedConditions) GetAdded() []*RepositoryRulesetConditions { + if r == nil || r.Added == nil { + return nil + } + return r.Added +} + +// GetDeleted returns the Deleted slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedConditions) GetDeleted() []*RepositoryRulesetConditions { + if r == nil || r.Deleted == nil { + return nil + } + return r.Deleted +} + +// GetUpdated returns the Updated slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedConditions) GetUpdated() []*RepositoryRulesetUpdatedConditions { + if r == nil || r.Updated == nil { + return nil + } + return r.Updated +} + // GetConfiguration returns the Configuration field. func (r *RepositoryRulesetChangedRule) GetConfiguration() *RepositoryRulesetChangeSource { if r == nil { @@ -25366,6 +32998,30 @@ func (r *RepositoryRulesetChangedRule) GetRuleType() *RepositoryRulesetChangeSou return r.RuleType } +// GetAdded returns the Added slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedRules) GetAdded() []*RepositoryRule { + if r == nil || r.Added == nil { + return nil + } + return r.Added +} + +// GetDeleted returns the Deleted slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedRules) GetDeleted() []*RepositoryRule { + if r == nil || r.Deleted == nil { + return nil + } + return r.Deleted +} + +// GetUpdated returns the Updated slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedRules) GetUpdated() []*RepositoryRulesetUpdatedRules { + if r == nil || r.Updated == nil { + return nil + } + return r.Updated +} + // GetConditions returns the Conditions field. func (r *RepositoryRulesetChanges) GetConditions() *RepositoryRulesetChangedConditions { if r == nil { @@ -25406,6 +33062,14 @@ func (r *RepositoryRulesetChangeSource) GetFrom() string { return *r.From } +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangeSources) GetFrom() []string { + if r == nil || r.From == nil { + return nil + } + return r.From +} + // GetOrganizationID returns the OrganizationID field. func (r *RepositoryRulesetConditions) GetOrganizationID() *RepositoryRulesetOrganizationIDsConditionParameters { if r == nil { @@ -25550,6 +33214,86 @@ func (r *RepositoryRulesetLinks) GetSelf() *RepositoryRulesetLink { return r.Self } +// GetOrganizationIDs returns the OrganizationIDs slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationIDsConditionParameters) GetOrganizationIDs() []int64 { + if r == nil || r.OrganizationIDs == nil { + return nil + } + return r.OrganizationIDs +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationNamesConditionParameters) GetExclude() []string { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationNamesConditionParameters) GetInclude() []string { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationPropertyConditionParameters) GetExclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationPropertyConditionParameters) GetInclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRefConditionParameters) GetExclude() []string { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRefConditionParameters) GetInclude() []string { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryIDsConditionParameters) GetRepositoryIDs() []int64 { + if r == nil || r.RepositoryIDs == nil { + return nil + } + return r.RepositoryIDs +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetExclude() []string { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetInclude() []string { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + // GetProtected returns the Protected field if it's non-nil, zero value otherwise. func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetProtected() bool { if r == nil || r.Protected == nil { @@ -25558,6 +33302,38 @@ func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetProtected() boo return *r.Protected } +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryPropertyConditionParameters) GetExclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryPropertyConditionParameters) GetInclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetName returns the Name field. +func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetPropertyValues returns the PropertyValues slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetPropertyValues() []string { + if r == nil || r.PropertyValues == nil { + return nil + } + return r.PropertyValues +} + // GetSource returns the Source field if it's non-nil, zero value otherwise. func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetSource() string { if r == nil || r.Source == nil { @@ -25878,6 +33654,22 @@ func (r *RepositoryTag) GetZipballURL() string { return *r.ZipballURL } +// GetInternal returns the Internal field. +func (r *RepositoryVisibilityRuleParameters) GetInternal() bool { + if r == nil { + return false + } + return r.Internal +} + +// GetPrivate returns the Private field. +func (r *RepositoryVisibilityRuleParameters) GetPrivate() bool { + if r == nil { + return false + } + return r.Private +} + // GetAffectedPackageName returns the AffectedPackageName field if it's non-nil, zero value otherwise. func (r *RepositoryVulnerabilityAlert) GetAffectedPackageName() string { if r == nil || r.AffectedPackageName == nil { @@ -26158,6 +33950,14 @@ func (r *RepoStatus) GetURL() string { return *r.URL } +// GetIdentifier returns the Identifier field. +func (r *RequestedAction) GetIdentifier() string { + if r == nil { + return "" + } + return r.Identifier +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequireCodeOwnerReviewChanges) GetFrom() bool { if r == nil || r.From == nil { @@ -26166,6 +33966,14 @@ func (r *RequireCodeOwnerReviewChanges) GetFrom() bool { return *r.From } +// GetEnabled returns the Enabled field. +func (r *RequiredConversationResolution) GetEnabled() bool { + if r == nil { + return false + } + return r.Enabled +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequiredConversationResolutionLevelChanges) GetFrom() string { if r == nil || r.From == nil { @@ -26174,6 +33982,14 @@ func (r *RequiredConversationResolutionLevelChanges) GetFrom() string { return *r.From } +// GetParameters returns the Parameters field. +func (r *RequiredDeploymentsBranchRule) GetParameters() RequiredDeploymentsRuleParameters { + if r == nil { + return RequiredDeploymentsRuleParameters{} + } + return r.Parameters +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequiredDeploymentsEnforcementLevelChanges) GetFrom() string { if r == nil || r.From == nil { @@ -26182,6 +33998,22 @@ func (r *RequiredDeploymentsEnforcementLevelChanges) GetFrom() string { return *r.From } +// GetRequiredDeploymentEnvironments returns the RequiredDeploymentEnvironments slice if it's non-nil, nil otherwise. +func (r *RequiredDeploymentsRuleParameters) GetRequiredDeploymentEnvironments() []string { + if r == nil || r.RequiredDeploymentEnvironments == nil { + return nil + } + return r.RequiredDeploymentEnvironments +} + +// GetReviewer returns the Reviewer field. +func (r *RequiredReviewer) GetReviewer() any { + if r == nil { + return nil + } + return r.Reviewer +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (r *RequiredReviewer) GetType() string { if r == nil || r.Type == nil { @@ -26198,6 +34030,14 @@ func (r *RequiredStatusCheck) GetAppID() int64 { return *r.AppID } +// GetContext returns the Context field. +func (r *RequiredStatusCheck) GetContext() string { + if r == nil { + return "" + } + return r.Context +} + // GetChecks returns the Checks field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecks) GetChecks() []*RequiredStatusCheck { if r == nil || r.Checks == nil { @@ -26222,6 +34062,14 @@ func (r *RequiredStatusChecks) GetContextsURL() string { return *r.ContextsURL } +// GetStrict returns the Strict field. +func (r *RequiredStatusChecks) GetStrict() bool { + if r == nil { + return false + } + return r.Strict +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecks) GetURL() string { if r == nil || r.URL == nil { @@ -26230,6 +34078,22 @@ func (r *RequiredStatusChecks) GetURL() string { return *r.URL } +// GetParameters returns the Parameters field. +func (r *RequiredStatusChecksBranchRule) GetParameters() RequiredStatusChecksRuleParameters { + if r == nil { + return RequiredStatusChecksRuleParameters{} + } + return r.Parameters +} + +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksChanges) GetFrom() []string { + if r == nil || r.From == nil { + return nil + } + return r.From +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string { if r == nil || r.From == nil { @@ -26238,6 +34102,22 @@ func (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string { return *r.From } +// GetChecks returns the Checks slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksRequest) GetChecks() []*RequiredStatusCheck { + if r == nil || r.Checks == nil { + return nil + } + return r.Checks +} + +// GetContexts returns the Contexts slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksRequest) GetContexts() []string { + if r == nil || r.Contexts == nil { + return nil + } + return r.Contexts +} + // GetStrict returns the Strict field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecksRequest) GetStrict() bool { if r == nil || r.Strict == nil { @@ -26254,6 +34134,22 @@ func (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool { return *r.DoNotEnforceOnCreate } +// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksRuleParameters) GetRequiredStatusChecks() []*RuleStatusCheck { + if r == nil || r.RequiredStatusChecks == nil { + return nil + } + return r.RequiredStatusChecks +} + +// GetStrictRequiredStatusChecksPolicy returns the StrictRequiredStatusChecksPolicy field. +func (r *RequiredStatusChecksRuleParameters) GetStrictRequiredStatusChecksPolicy() bool { + if r == nil { + return false + } + return r.StrictRequiredStatusChecksPolicy +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequireLastPushApprovalChanges) GetFrom() bool { if r == nil || r.From == nil { @@ -26262,6 +34158,134 @@ func (r *RequireLastPushApprovalChanges) GetFrom() bool { return *r.From } +// GetEnabled returns the Enabled field. +func (r *RequireLinearHistory) GetEnabled() bool { + if r == nil { + return false + } + return r.Enabled +} + +// GetAfter returns the After field. +func (r *Response) GetAfter() string { + if r == nil { + return "" + } + return r.After +} + +// GetBefore returns the Before field. +func (r *Response) GetBefore() string { + if r == nil { + return "" + } + return r.Before +} + +// GetCursor returns the Cursor field. +func (r *Response) GetCursor() string { + if r == nil { + return "" + } + return r.Cursor +} + +// GetFirstPage returns the FirstPage field. +func (r *Response) GetFirstPage() int { + if r == nil { + return 0 + } + return r.FirstPage +} + +// GetLastPage returns the LastPage field. +func (r *Response) GetLastPage() int { + if r == nil { + return 0 + } + return r.LastPage +} + +// GetNextPage returns the NextPage field. +func (r *Response) GetNextPage() int { + if r == nil { + return 0 + } + return r.NextPage +} + +// GetNextPageToken returns the NextPageToken field. +func (r *Response) GetNextPageToken() string { + if r == nil { + return "" + } + return r.NextPageToken +} + +// GetPrevPage returns the PrevPage field. +func (r *Response) GetPrevPage() int { + if r == nil { + return 0 + } + return r.PrevPage +} + +// GetRate returns the Rate field. +func (r *Response) GetRate() Rate { + if r == nil { + return Rate{} + } + return r.Rate +} + +// GetTokenExpiration returns the TokenExpiration field. +func (r *Response) GetTokenExpiration() Timestamp { + if r == nil { + return Timestamp{} + } + return r.TokenExpiration +} + +// GetComment returns the Comment field. +func (r *ReviewCustomDeploymentProtectionRuleRequest) GetComment() string { + if r == nil { + return "" + } + return r.Comment +} + +// GetEnvironmentName returns the EnvironmentName field. +func (r *ReviewCustomDeploymentProtectionRuleRequest) GetEnvironmentName() string { + if r == nil { + return "" + } + return r.EnvironmentName +} + +// GetState returns the State field. +func (r *ReviewCustomDeploymentProtectionRuleRequest) GetState() string { + if r == nil { + return "" + } + return r.State +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (r *Reviewers) GetTeams() []*Team { + if r == nil || r.Teams == nil { + return nil + } + return r.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (r *Reviewers) GetUsers() []*User { + if r == nil || r.Users == nil { + return nil + } + return r.Users +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *ReviewersRequest) GetNodeID() string { if r == nil || r.NodeID == nil { @@ -26270,6 +34294,30 @@ func (r *ReviewersRequest) GetNodeID() string { return *r.NodeID } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (r *ReviewersRequest) GetReviewers() []string { + if r == nil || r.Reviewers == nil { + return nil + } + return r.Reviewers +} + +// GetTeamReviewers returns the TeamReviewers slice if it's non-nil, nil otherwise. +func (r *ReviewersRequest) GetTeamReviewers() []string { + if r == nil || r.TeamReviewers == nil { + return nil + } + return r.TeamReviewers +} + +// GetAction returns the Action field. +func (r *ReviewPersonalAccessTokenRequestOptions) GetAction() string { + if r == nil { + return "" + } + return r.Action +} + // GetReason returns the Reason field if it's non-nil, zero value otherwise. func (r *ReviewPersonalAccessTokenRequestOptions) GetReason() string { if r == nil || r.Reason == nil { @@ -26334,6 +34382,46 @@ func (r *Rule) GetSeverity() string { return *r.Severity } +// GetTags returns the Tags slice if it's non-nil, nil otherwise. +func (r *Rule) GetTags() []string { + if r == nil || r.Tags == nil { + return nil + } + return r.Tags +} + +// GetAlertsThreshold returns the AlertsThreshold field. +func (r *RuleCodeScanningTool) GetAlertsThreshold() CodeScanningAlertsThreshold { + if r == nil { + return "" + } + return r.AlertsThreshold +} + +// GetSecurityAlertsThreshold returns the SecurityAlertsThreshold field. +func (r *RuleCodeScanningTool) GetSecurityAlertsThreshold() CodeScanningSecurityAlertsThreshold { + if r == nil { + return "" + } + return r.SecurityAlertsThreshold +} + +// GetTool returns the Tool field. +func (r *RuleCodeScanningTool) GetTool() string { + if r == nil { + return "" + } + return r.Tool +} + +// GetFilePatterns returns the FilePatterns slice if it's non-nil, nil otherwise. +func (r *RulesetRequiredReviewer) GetFilePatterns() []string { + if r == nil || r.FilePatterns == nil { + return nil + } + return r.FilePatterns +} + // GetMinimumApprovals returns the MinimumApprovals field if it's non-nil, zero value otherwise. func (r *RulesetRequiredReviewer) GetMinimumApprovals() int { if r == nil || r.MinimumApprovals == nil { @@ -26366,6 +34454,14 @@ func (r *RulesetReviewer) GetType() *RulesetReviewerType { return r.Type } +// GetContext returns the Context field. +func (r *RuleStatusCheck) GetContext() string { + if r == nil { + return "" + } + return r.Context +} + // GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. func (r *RuleStatusCheck) GetIntegrationID() int64 { if r == nil || r.IntegrationID == nil { @@ -26374,6 +34470,14 @@ func (r *RuleStatusCheck) GetIntegrationID() int64 { return *r.IntegrationID } +// GetPath returns the Path field. +func (r *RuleWorkflow) GetPath() string { + if r == nil { + return "" + } + return r.Path +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (r *RuleWorkflow) GetRef() string { if r == nil || r.Ref == nil { @@ -26414,6 +34518,14 @@ func (r *Runner) GetID() int64 { return *r.ID } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (r *Runner) GetLabels() []*RunnerLabels { + if r == nil || r.Labels == nil { + return nil + } + return r.Labels +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (r *Runner) GetName() string { if r == nil || r.Name == nil { @@ -26566,6 +34678,14 @@ func (r *RunnerGroup) GetSelectedRepositoriesURL() string { return *r.SelectedRepositoriesURL } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (r *RunnerGroup) GetSelectedWorkflows() []string { + if r == nil || r.SelectedWorkflows == nil { + return nil + } + return r.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (r *RunnerGroup) GetVisibility() string { if r == nil || r.Visibility == nil { @@ -26582,6 +34702,22 @@ func (r *RunnerGroup) GetWorkflowRestrictionsReadOnly() bool { return *r.WorkflowRestrictionsReadOnly } +// GetRunnerGroups returns the RunnerGroups slice if it's non-nil, nil otherwise. +func (r *RunnerGroups) GetRunnerGroups() []*RunnerGroup { + if r == nil || r.RunnerGroups == nil { + return nil + } + return r.RunnerGroups +} + +// GetTotalCount returns the TotalCount field. +func (r *RunnerGroups) GetTotalCount() int { + if r == nil { + return 0 + } + return r.TotalCount +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *RunnerLabels) GetID() int64 { if r == nil || r.ID == nil { @@ -26606,6 +34742,22 @@ func (r *RunnerLabels) GetType() string { return *r.Type } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (r *Runners) GetRunners() []*Runner { + if r == nil || r.Runners == nil { + return nil + } + return r.Runners +} + +// GetTotalCount returns the TotalCount field. +func (r *Runners) GetTotalCount() int { + if r == nil { + return 0 + } + return r.TotalCount +} + // GetCheckoutURI returns the CheckoutURI field if it's non-nil, zero value otherwise. func (s *SarifAnalysis) GetCheckoutURI() string { if s == nil || s.CheckoutURI == nil { @@ -26710,6 +34862,14 @@ func (s *SBOMInfo) GetDataLicense() string { return *s.DataLicense } +// GetDocumentDescribes returns the DocumentDescribes slice if it's non-nil, nil otherwise. +func (s *SBOMInfo) GetDocumentDescribes() []string { + if s == nil || s.DocumentDescribes == nil { + return nil + } + return s.DocumentDescribes +} + // GetDocumentNamespace returns the DocumentNamespace field if it's non-nil, zero value otherwise. func (s *SBOMInfo) GetDocumentNamespace() string { if s == nil || s.DocumentNamespace == nil { @@ -26726,6 +34886,22 @@ func (s *SBOMInfo) GetName() string { return *s.Name } +// GetPackages returns the Packages slice if it's non-nil, nil otherwise. +func (s *SBOMInfo) GetPackages() []*RepoDependencies { + if s == nil || s.Packages == nil { + return nil + } + return s.Packages +} + +// GetRelationships returns the Relationships slice if it's non-nil, nil otherwise. +func (s *SBOMInfo) GetRelationships() []*SBOMRelationship { + if s == nil || s.Relationships == nil { + return nil + } + return s.Relationships +} + // GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise. func (s *SBOMInfo) GetSPDXID() string { if s == nil || s.SPDXID == nil { @@ -26742,6 +34918,30 @@ func (s *SBOMInfo) GetSPDXVersion() string { return *s.SPDXVersion } +// GetRelatedSPDXElement returns the RelatedSPDXElement field. +func (s *SBOMRelationship) GetRelatedSPDXElement() string { + if s == nil { + return "" + } + return s.RelatedSPDXElement +} + +// GetRelationshipType returns the RelationshipType field. +func (s *SBOMRelationship) GetRelationshipType() string { + if s == nil { + return "" + } + return s.RelationshipType +} + +// GetSPDXElementID returns the SPDXElementID field. +func (s *SBOMRelationship) GetSPDXElementID() string { + if s == nil { + return "" + } + return s.SPDXElementID +} + // GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise. func (s *ScanningAnalysis) GetAnalysisKey() string { if s == nil || s.AnalysisKey == nil { @@ -26862,6 +35062,30 @@ func (s *ScanningAnalysis) GetWarning() string { return *s.Warning } +// GetOperations returns the Operations slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseAttribute) GetOperations() []*SCIMEnterpriseAttributeOperation { + if s == nil || s.Operations == nil { + return nil + } + return s.Operations +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseAttribute) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + +// GetOp returns the Op field. +func (s *SCIMEnterpriseAttributeOperation) GetOp() string { + if s == nil { + return "" + } + return s.Op +} + // GetPath returns the Path field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseAttributeOperation) GetPath() string { if s == nil || s.Path == nil { @@ -26870,12 +35094,12 @@ func (s *SCIMEnterpriseAttributeOperation) GetPath() string { return *s.Path } -// GetValue returns the Value field if it's non-nil, zero value otherwise. -func (s *SCIMEnterpriseAttributeOperation) GetValue() string { - if s == nil || s.Value == nil { - return "" +// GetValue returns the Value field. +func (s *SCIMEnterpriseAttributeOperation) GetValue() any { + if s == nil { + return nil } - return *s.Value + return s.Value } // GetDisplay returns the Display field if it's non-nil, zero value otherwise. @@ -26894,6 +35118,14 @@ func (s *SCIMEnterpriseDisplayReference) GetRef() string { return *s.Ref } +// GetValue returns the Value field. +func (s *SCIMEnterpriseDisplayReference) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseGroupAttributes) GetDisplayName() string { if s == nil || s.DisplayName == nil { @@ -26918,6 +35150,14 @@ func (s *SCIMEnterpriseGroupAttributes) GetID() string { return *s.ID } +// GetMembers returns the Members slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroupAttributes) GetMembers() []*SCIMEnterpriseDisplayReference { + if s == nil || s.Members == nil { + return nil + } + return s.Members +} + // GetMeta returns the Meta field. func (s *SCIMEnterpriseGroupAttributes) GetMeta() *SCIMEnterpriseMeta { if s == nil { @@ -26926,6 +35166,14 @@ func (s *SCIMEnterpriseGroupAttributes) GetMeta() *SCIMEnterpriseMeta { return s.Meta } +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroupAttributes) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseGroups) GetItemsPerPage() int { if s == nil || s.ItemsPerPage == nil { @@ -26934,6 +35182,22 @@ func (s *SCIMEnterpriseGroups) GetItemsPerPage() int { return *s.ItemsPerPage } +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroups) GetResources() []*SCIMEnterpriseGroupAttributes { + if s == nil || s.Resources == nil { + return nil + } + return s.Resources +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroups) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseGroups) GetStartIndex() int { if s == nil || s.StartIndex == nil { @@ -26974,6 +35238,54 @@ func (s *SCIMEnterpriseMeta) GetLocation() string { return *s.Location } +// GetResourceType returns the ResourceType field. +func (s *SCIMEnterpriseMeta) GetResourceType() string { + if s == nil { + return "" + } + return s.ResourceType +} + +// GetActive returns the Active field. +func (s *SCIMEnterpriseUserAttributes) GetActive() bool { + if s == nil { + return false + } + return s.Active +} + +// GetDisplayName returns the DisplayName field. +func (s *SCIMEnterpriseUserAttributes) GetDisplayName() string { + if s == nil { + return "" + } + return s.DisplayName +} + +// GetEmails returns the Emails slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetEmails() []*SCIMEnterpriseUserEmail { + if s == nil || s.Emails == nil { + return nil + } + return s.Emails +} + +// GetExternalID returns the ExternalID field. +func (s *SCIMEnterpriseUserAttributes) GetExternalID() string { + if s == nil { + return "" + } + return s.ExternalID +} + +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetGroups() []*SCIMEnterpriseDisplayReference { + if s == nil || s.Groups == nil { + return nil + } + return s.Groups +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUserAttributes) GetID() string { if s == nil || s.ID == nil { @@ -26998,6 +35310,62 @@ func (s *SCIMEnterpriseUserAttributes) GetName() *SCIMEnterpriseUserName { return s.Name } +// GetRoles returns the Roles slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetRoles() []*SCIMEnterpriseUserRole { + if s == nil || s.Roles == nil { + return nil + } + return s.Roles +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + +// GetUserName returns the UserName field. +func (s *SCIMEnterpriseUserAttributes) GetUserName() string { + if s == nil { + return "" + } + return s.UserName +} + +// GetPrimary returns the Primary field. +func (s *SCIMEnterpriseUserEmail) GetPrimary() bool { + if s == nil { + return false + } + return s.Primary +} + +// GetType returns the Type field. +func (s *SCIMEnterpriseUserEmail) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +// GetValue returns the Value field. +func (s *SCIMEnterpriseUserEmail) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + +// GetFamilyName returns the FamilyName field. +func (s *SCIMEnterpriseUserName) GetFamilyName() string { + if s == nil { + return "" + } + return s.FamilyName +} + // GetFormatted returns the Formatted field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUserName) GetFormatted() string { if s == nil || s.Formatted == nil { @@ -27006,6 +35374,14 @@ func (s *SCIMEnterpriseUserName) GetFormatted() string { return *s.Formatted } +// GetGivenName returns the GivenName field. +func (s *SCIMEnterpriseUserName) GetGivenName() string { + if s == nil { + return "" + } + return s.GivenName +} + // GetMiddleName returns the MiddleName field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUserName) GetMiddleName() string { if s == nil || s.MiddleName == nil { @@ -27038,6 +35414,14 @@ func (s *SCIMEnterpriseUserRole) GetType() string { return *s.Type } +// GetValue returns the Value field. +func (s *SCIMEnterpriseUserRole) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + // GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUsers) GetItemsPerPage() int { if s == nil || s.ItemsPerPage == nil { @@ -27046,6 +35430,22 @@ func (s *SCIMEnterpriseUsers) GetItemsPerPage() int { return *s.ItemsPerPage } +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUsers) GetResources() []*SCIMEnterpriseUserAttributes { + if s == nil || s.Resources == nil { + return nil + } + return s.Resources +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUsers) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUsers) GetStartIndex() int { if s == nil || s.StartIndex == nil { @@ -27102,6 +35502,22 @@ func (s *SCIMProvisionedIdentities) GetItemsPerPage() int { return *s.ItemsPerPage } +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (s *SCIMProvisionedIdentities) GetResources() []*SCIMUserAttributes { + if s == nil || s.Resources == nil { + return nil + } + return s.Resources +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMProvisionedIdentities) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. func (s *SCIMProvisionedIdentities) GetStartIndex() int { if s == nil || s.StartIndex == nil { @@ -27134,6 +35550,14 @@ func (s *SCIMUserAttributes) GetDisplayName() string { return *s.DisplayName } +// GetEmails returns the Emails slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetEmails() []*SCIMUserEmail { + if s == nil || s.Emails == nil { + return nil + } + return s.Emails +} + // GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetExternalID() string { if s == nil || s.ExternalID == nil { @@ -27142,6 +35566,14 @@ func (s *SCIMUserAttributes) GetExternalID() string { return *s.ExternalID } +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetGroups() []string { + if s == nil || s.Groups == nil { + return nil + } + return s.Groups +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetID() string { if s == nil || s.ID == nil { @@ -27158,6 +35590,38 @@ func (s *SCIMUserAttributes) GetMeta() *SCIMMeta { return s.Meta } +// GetName returns the Name field. +func (s *SCIMUserAttributes) GetName() SCIMUserName { + if s == nil { + return SCIMUserName{} + } + return s.Name +} + +// GetRoles returns the Roles slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetRoles() []*SCIMUserRole { + if s == nil || s.Roles == nil { + return nil + } + return s.Roles +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + +// GetUserName returns the UserName field. +func (s *SCIMUserAttributes) GetUserName() string { + if s == nil { + return "" + } + return s.UserName +} + // GetPrimary returns the Primary field if it's non-nil, zero value otherwise. func (s *SCIMUserEmail) GetPrimary() bool { if s == nil || s.Primary == nil { @@ -27174,6 +35638,22 @@ func (s *SCIMUserEmail) GetType() string { return *s.Type } +// GetValue returns the Value field. +func (s *SCIMUserEmail) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + +// GetFamilyName returns the FamilyName field. +func (s *SCIMUserName) GetFamilyName() string { + if s == nil { + return "" + } + return s.FamilyName +} + // GetFormatted returns the Formatted field if it's non-nil, zero value otherwise. func (s *SCIMUserName) GetFormatted() string { if s == nil || s.Formatted == nil { @@ -27182,6 +35662,14 @@ func (s *SCIMUserName) GetFormatted() string { return *s.Formatted } +// GetGivenName returns the GivenName field. +func (s *SCIMUserName) GetGivenName() string { + if s == nil { + return "" + } + return s.GivenName +} + // GetDisplay returns the Display field if it's non-nil, zero value otherwise. func (s *SCIMUserRole) GetDisplay() string { if s == nil || s.Display == nil { @@ -27206,6 +35694,14 @@ func (s *SCIMUserRole) GetType() string { return *s.Type } +// GetValue returns the Value field. +func (s *SCIMUserRole) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + // GetAdvancedSearch returns the AdvancedSearch field if it's non-nil, zero value otherwise. func (s *SearchOptions) GetAdvancedSearch() bool { if s == nil || s.AdvancedSearch == nil { @@ -27214,6 +35710,102 @@ func (s *SearchOptions) GetAdvancedSearch() bool { return *s.AdvancedSearch } +// GetOrder returns the Order field. +func (s *SearchOptions) GetOrder() string { + if s == nil { + return "" + } + return s.Order +} + +// GetSort returns the Sort field. +func (s *SearchOptions) GetSort() string { + if s == nil { + return "" + } + return s.Sort +} + +// GetTextMatch returns the TextMatch field. +func (s *SearchOptions) GetTextMatch() bool { + if s == nil { + return false + } + return s.TextMatch +} + +// GetSeatsCreated returns the SeatsCreated field. +func (s *SeatAssignments) GetSeatsCreated() int { + if s == nil { + return 0 + } + return s.SeatsCreated +} + +// GetSeatsCancelled returns the SeatsCancelled field. +func (s *SeatCancellations) GetSeatsCancelled() int { + if s == nil { + return 0 + } + return s.SeatsCancelled +} + +// GetCreatedAt returns the CreatedAt field. +func (s *Secret) GetCreatedAt() Timestamp { + if s == nil { + return Timestamp{} + } + return s.CreatedAt +} + +// GetName returns the Name field. +func (s *Secret) GetName() string { + if s == nil { + return "" + } + return s.Name +} + +// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field. +func (s *Secret) GetSelectedRepositoriesURL() string { + if s == nil { + return "" + } + return s.SelectedRepositoriesURL +} + +// GetUpdatedAt returns the UpdatedAt field. +func (s *Secret) GetUpdatedAt() Timestamp { + if s == nil { + return Timestamp{} + } + return s.UpdatedAt +} + +// GetVisibility returns the Visibility field. +func (s *Secret) GetVisibility() string { + if s == nil { + return "" + } + return s.Visibility +} + +// GetSecrets returns the Secrets slice if it's non-nil, nil otherwise. +func (s *Secrets) GetSecrets() []*Secret { + if s == nil || s.Secrets == nil { + return nil + } + return s.Secrets +} + +// GetTotalCount returns the TotalCount field. +func (s *Secrets) GetTotalCount() int { + if s == nil { + return 0 + } + return s.TotalCount +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanning) GetStatus() string { if s == nil || s.Status == nil { @@ -27502,6 +36094,70 @@ func (s *SecretScanningAlertEvent) GetSender() *User { return s.Sender } +// GetDirection returns the Direction field. +func (s *SecretScanningAlertListOptions) GetDirection() string { + if s == nil { + return "" + } + return s.Direction +} + +// GetIsMultiRepo returns the IsMultiRepo field. +func (s *SecretScanningAlertListOptions) GetIsMultiRepo() bool { + if s == nil { + return false + } + return s.IsMultiRepo +} + +// GetIsPubliclyLeaked returns the IsPubliclyLeaked field. +func (s *SecretScanningAlertListOptions) GetIsPubliclyLeaked() bool { + if s == nil { + return false + } + return s.IsPubliclyLeaked +} + +// GetResolution returns the Resolution field. +func (s *SecretScanningAlertListOptions) GetResolution() string { + if s == nil { + return "" + } + return s.Resolution +} + +// GetSecretType returns the SecretType field. +func (s *SecretScanningAlertListOptions) GetSecretType() string { + if s == nil { + return "" + } + return s.SecretType +} + +// GetSort returns the Sort field. +func (s *SecretScanningAlertListOptions) GetSort() string { + if s == nil { + return "" + } + return s.Sort +} + +// GetState returns the State field. +func (s *SecretScanningAlertListOptions) GetState() string { + if s == nil { + return "" + } + return s.State +} + +// GetValidity returns the Validity field. +func (s *SecretScanningAlertListOptions) GetValidity() string { + if s == nil { + return "" + } + return s.Validity +} + // GetDetails returns the Details field. func (s *SecretScanningAlertLocation) GetDetails() *SecretScanningAlertLocationDetails { if s == nil { @@ -27670,6 +36326,14 @@ func (s *SecretScanningAlertUpdateOptions) GetResolutionComment() string { return *s.ResolutionComment } +// GetState returns the State field. +func (s *SecretScanningAlertUpdateOptions) GetState() string { + if s == nil { + return "" + } + return s.State +} + // GetCustomPatternVersion returns the CustomPatternVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningCustomPatternSetting) GetCustomPatternVersion() string { if s == nil || s.CustomPatternVersion == nil { @@ -27678,6 +36342,38 @@ func (s *SecretScanningCustomPatternSetting) GetCustomPatternVersion() string { return *s.CustomPatternVersion } +// GetPushProtectionSetting returns the PushProtectionSetting field. +func (s *SecretScanningCustomPatternSetting) GetPushProtectionSetting() string { + if s == nil { + return "" + } + return s.PushProtectionSetting +} + +// GetTokenType returns the TokenType field. +func (s *SecretScanningCustomPatternSetting) GetTokenType() string { + if s == nil { + return "" + } + return s.TokenType +} + +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (s *SecretScanningDelegatedBypassOptions) GetReviewers() []*BypassReviewer { + if s == nil || s.Reviewers == nil { + return nil + } + return s.Reviewers +} + +// GetCustomPatternOverrides returns the CustomPatternOverrides slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigs) GetCustomPatternOverrides() []*SecretScanningPatternOverride { + if s == nil || s.CustomPatternOverrides == nil { + return nil + } + return s.CustomPatternOverrides +} + // GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternConfigs) GetPatternConfigVersion() string { if s == nil || s.PatternConfigVersion == nil { @@ -27686,6 +36382,14 @@ func (s *SecretScanningPatternConfigs) GetPatternConfigVersion() string { return *s.PatternConfigVersion } +// GetProviderPatternOverrides returns the ProviderPatternOverrides slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigs) GetProviderPatternOverrides() []*SecretScanningPatternOverride { + if s == nil || s.ProviderPatternOverrides == nil { + return nil + } + return s.ProviderPatternOverrides +} + // GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternConfigsUpdate) GetPatternConfigVersion() string { if s == nil || s.PatternConfigVersion == nil { @@ -27694,6 +36398,14 @@ func (s *SecretScanningPatternConfigsUpdate) GetPatternConfigVersion() string { return *s.PatternConfigVersion } +// GetCustomPatternSettings returns the CustomPatternSettings slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigsUpdateOptions) GetCustomPatternSettings() []*SecretScanningCustomPatternSetting { + if s == nil || s.CustomPatternSettings == nil { + return nil + } + return s.CustomPatternSettings +} + // GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternConfigsUpdateOptions) GetPatternConfigVersion() string { if s == nil || s.PatternConfigVersion == nil { @@ -27702,6 +36414,14 @@ func (s *SecretScanningPatternConfigsUpdateOptions) GetPatternConfigVersion() st return *s.PatternConfigVersion } +// GetProviderPatternSettings returns the ProviderPatternSettings slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigsUpdateOptions) GetProviderPatternSettings() []*SecretScanningProviderPatternSetting { + if s == nil || s.ProviderPatternSettings == nil { + return nil + } + return s.ProviderPatternSettings +} + // GetAlertTotal returns the AlertTotal field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternOverride) GetAlertTotal() int { if s == nil || s.AlertTotal == nil { @@ -27798,6 +36518,22 @@ func (s *SecretScanningPatternOverride) GetTokenType() string { return *s.TokenType } +// GetPushProtectionSetting returns the PushProtectionSetting field. +func (s *SecretScanningProviderPatternSetting) GetPushProtectionSetting() string { + if s == nil { + return "" + } + return s.PushProtectionSetting +} + +// GetTokenType returns the TokenType field. +func (s *SecretScanningProviderPatternSetting) GetTokenType() string { + if s == nil { + return "" + } + return s.TokenType +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningPushProtection) GetStatus() string { if s == nil || s.Status == nil { @@ -27806,6 +36542,38 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetBackfillScans returns the BackfillScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetBackfillScans() []*SecretsScan { + if s == nil || s.BackfillScans == nil { + return nil + } + return s.BackfillScans +} + +// GetCustomPatternBackfillScans returns the CustomPatternBackfillScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetCustomPatternBackfillScans() []*CustomPatternBackfillScan { + if s == nil || s.CustomPatternBackfillScans == nil { + return nil + } + return s.CustomPatternBackfillScans +} + +// GetIncrementalScans returns the IncrementalScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetIncrementalScans() []*SecretsScan { + if s == nil || s.IncrementalScans == nil { + return nil + } + return s.IncrementalScans +} + +// GetPatternUpdateScans returns the PatternUpdateScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetPatternUpdateScans() []*SecretsScan { + if s == nil || s.PatternUpdateScans == nil { + return nil + } + return s.PatternUpdateScans +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningValidityChecks) GetStatus() string { if s == nil || s.Status == nil { @@ -27830,6 +36598,22 @@ func (s *SecretsScan) GetStartedAt() Timestamp { return *s.StartedAt } +// GetStatus returns the Status field. +func (s *SecretsScan) GetStatus() string { + if s == nil { + return "" + } + return s.Status +} + +// GetType returns the Type field. +func (s *SecretsScan) GetType() string { + if s == nil { + return "" + } + return s.Type +} + // GetAuthor returns the Author field. func (s *SecurityAdvisory) GetAuthor() *User { if s == nil { @@ -27846,6 +36630,22 @@ func (s *SecurityAdvisory) GetClosedAt() Timestamp { return *s.ClosedAt } +// GetCollaboratingTeams returns the CollaboratingTeams slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCollaboratingTeams() []*Team { + if s == nil || s.CollaboratingTeams == nil { + return nil + } + return s.CollaboratingTeams +} + +// GetCollaboratingUsers returns the CollaboratingUsers slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCollaboratingUsers() []*User { + if s == nil || s.CollaboratingUsers == nil { + return nil + } + return s.CollaboratingUsers +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -27854,6 +36654,22 @@ func (s *SecurityAdvisory) GetCreatedAt() Timestamp { return *s.CreatedAt } +// GetCredits returns the Credits slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCredits() []*RepoAdvisoryCredit { + if s == nil || s.Credits == nil { + return nil + } + return s.Credits +} + +// GetCreditsDetailed returns the CreditsDetailed slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCreditsDetailed() []*RepoAdvisoryCreditDetailed { + if s == nil || s.CreditsDetailed == nil { + return nil + } + return s.CreditsDetailed +} + // GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetCVEID() string { if s == nil || s.CVEID == nil { @@ -27870,6 +36686,22 @@ func (s *SecurityAdvisory) GetCVSS() *AdvisoryCVSS { return s.CVSS } +// GetCWEIDs returns the CWEIDs slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCWEIDs() []string { + if s == nil || s.CWEIDs == nil { + return nil + } + return s.CWEIDs +} + +// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCWEs() []*AdvisoryCWEs { + if s == nil || s.CWEs == nil { + return nil + } + return s.CWEs +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetDescription() string { if s == nil || s.Description == nil { @@ -27894,6 +36726,14 @@ func (s *SecurityAdvisory) GetHTMLURL() string { return *s.HTMLURL } +// GetIdentifiers returns the Identifiers slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetIdentifiers() []*AdvisoryIdentifier { + if s == nil || s.Identifiers == nil { + return nil + } + return s.Identifiers +} + // GetPrivateFork returns the PrivateFork field. func (s *SecurityAdvisory) GetPrivateFork() *Repository { if s == nil { @@ -27918,6 +36758,14 @@ func (s *SecurityAdvisory) GetPublisher() *User { return s.Publisher } +// GetReferences returns the References slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetReferences() []*AdvisoryReference { + if s == nil || s.References == nil { + return nil + } + return s.References +} + // GetSeverity returns the Severity field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetSeverity() string { if s == nil || s.Severity == nil { @@ -27966,6 +36814,14 @@ func (s *SecurityAdvisory) GetURL() string { return *s.URL } +// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetVulnerabilities() []*AdvisoryVulnerability { + if s == nil || s.Vulnerabilities == nil { + return nil + } + return s.Vulnerabilities +} + // GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetWithdrawnAt() Timestamp { if s == nil || s.WithdrawnAt == nil { @@ -28046,6 +36902,14 @@ func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { return s.AdvancedSecurity } +// GetCodeSecurity returns the CodeSecurity field. +func (s *SecurityAndAnalysis) GetCodeSecurity() *CodeSecurity { + if s == nil { + return nil + } + return s.CodeSecurity +} + // GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field. func (s *SecurityAndAnalysis) GetDependabotSecurityUpdates() *DependabotSecurityUpdates { if s == nil { @@ -28142,6 +37006,14 @@ func (s *SecurityAndAnalysisEvent) GetSender() *User { return s.Sender } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (s *SelectedReposList) GetRepositories() []*Repository { + if s == nil || s.Repositories == nil { + return nil + } + return s.Repositories +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (s *SelectedReposList) GetTotalCount() int { if s == nil || s.TotalCount == nil { @@ -28150,6 +37022,22 @@ func (s *SelectedReposList) GetTotalCount() int { return *s.TotalCount } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (s *SelfHostedRunnersAllowedRepos) GetRepositories() []*Repository { + if s == nil || s.Repositories == nil { + return nil + } + return s.Repositories +} + +// GetTotalCount returns the TotalCount field. +func (s *SelfHostedRunnersAllowedRepos) GetTotalCount() int { + if s == nil { + return 0 + } + return s.TotalCount +} + // GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise. func (s *SelfHostedRunnersSettingsOrganization) GetEnabledRepositories() string { if s == nil || s.EnabledRepositories == nil { @@ -28198,6 +37086,22 @@ func (s *ServerInstances) GetItems() *ServiceInstanceItems { return s.Items } +// GetType returns the Type field. +func (s *ServerInstances) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +// GetHostname returns the Hostname field. +func (s *ServerItemProperties) GetHostname() string { + if s == nil { + return "" + } + return s.Hostname +} + // GetLastSync returns the LastSync field. func (s *ServerItemProperties) GetLastSync() *LastLicenseSync { if s == nil { @@ -28206,6 +37110,14 @@ func (s *ServerItemProperties) GetLastSync() *LastLicenseSync { return s.LastSync } +// GetServerID returns the ServerID field. +func (s *ServerItemProperties) GetServerID() string { + if s == nil { + return "" + } + return s.ServerID +} + // GetProperties returns the Properties field. func (s *ServiceInstanceItems) GetProperties() *ServerItemProperties { if s == nil { @@ -28214,6 +37126,38 @@ func (s *ServiceInstanceItems) GetProperties() *ServerItemProperties { return s.Properties } +// GetType returns the Type field. +func (s *ServiceInstanceItems) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +// GetSelectedOrganizationIDs returns the SelectedOrganizationIDs slice if it's non-nil, nil otherwise. +func (s *SetOrgAccessRunnerGroupRequest) GetSelectedOrganizationIDs() []int64 { + if s == nil || s.SelectedOrganizationIDs == nil { + return nil + } + return s.SelectedOrganizationIDs +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (s *SetRepoAccessRunnerGroupRequest) GetSelectedRepositoryIDs() []int64 { + if s == nil || s.SelectedRepositoryIDs == nil { + return nil + } + return s.SelectedRepositoryIDs +} + +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (s *SetRunnerGroupRunnersRequest) GetRunners() []int64 { + if s == nil || s.Runners == nil { + return nil + } + return s.Runners +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string { if s == nil || s.From == nil { @@ -28270,6 +37214,22 @@ func (s *SignatureVerification) GetVerified() bool { return *s.Verified } +// GetNegate returns the Negate field. +func (s *SimplePatternRuleParameters) GetNegate() bool { + if s == nil { + return false + } + return s.Negate +} + +// GetPattern returns the Pattern field. +func (s *SimplePatternRuleParameters) GetPattern() string { + if s == nil { + return "" + } + return s.Pattern +} + // GetProvider returns the Provider field if it's non-nil, zero value otherwise. func (s *SocialAccount) GetProvider() string { if s == nil || s.Provider == nil { @@ -28382,6 +37342,46 @@ func (s *SourceImportAuthor) GetURL() string { return *s.URL } +// GetDomain returns the Domain field. +func (s *SplunkConfig) GetDomain() string { + if s == nil { + return "" + } + return s.Domain +} + +// GetEncryptedToken returns the EncryptedToken field. +func (s *SplunkConfig) GetEncryptedToken() string { + if s == nil { + return "" + } + return s.EncryptedToken +} + +// GetKeyID returns the KeyID field. +func (s *SplunkConfig) GetKeyID() string { + if s == nil { + return "" + } + return s.KeyID +} + +// GetPort returns the Port field. +func (s *SplunkConfig) GetPort() uint16 { + if s == nil { + return 0 + } + return s.Port +} + +// GetSSLVerify returns the SSLVerify field. +func (s *SplunkConfig) GetSSLVerify() bool { + if s == nil { + return false + } + return s.SSLVerify +} + // GetPrivacyLevel returns the PrivacyLevel field if it's non-nil, zero value otherwise. func (s *SponsorshipChanges) GetPrivacyLevel() string { if s == nil || s.PrivacyLevel == nil { @@ -28462,6 +37462,14 @@ func (s *SponsorshipTier) GetFrom() string { return *s.From } +// GetKey returns the Key field. +func (s *SSHKeyOptions) GetKey() string { + if s == nil { + return "" + } + return s.Key +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (s *SSHKeyStatus) GetHostname() string { if s == nil || s.Hostname == nil { @@ -28606,6 +37614,14 @@ func (s *StarredRepository) GetStarredAt() Timestamp { return *s.StarredAt } +// GetBranches returns the Branches slice if it's non-nil, nil otherwise. +func (s *StatusEvent) GetBranches() []*Branch { + if s == nil || s.Branches == nil { + return nil + } + return s.Branches +} + // GetCommit returns the Commit field. func (s *StatusEvent) GetCommit() *RepositoryCommit { if s == nil { @@ -28718,6 +37734,30 @@ func (s *StatusEvent) GetUpdatedAt() Timestamp { return *s.UpdatedAt } +// GetDaysLeftInBillingCycle returns the DaysLeftInBillingCycle field. +func (s *StorageBilling) GetDaysLeftInBillingCycle() int { + if s == nil { + return 0 + } + return s.DaysLeftInBillingCycle +} + +// GetEstimatedPaidStorageForMonth returns the EstimatedPaidStorageForMonth field. +func (s *StorageBilling) GetEstimatedPaidStorageForMonth() int { + if s == nil { + return 0 + } + return s.EstimatedPaidStorageForMonth +} + +// GetEstimatedStorageForMonth returns the EstimatedStorageForMonth field. +func (s *StorageBilling) GetEstimatedStorageForMonth() int { + if s == nil { + return 0 + } + return s.EstimatedStorageForMonth +} + // GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. func (s *SubIssueRequest) GetAfterID() int64 { if s == nil || s.AfterID == nil { @@ -28742,6 +37782,14 @@ func (s *SubIssueRequest) GetReplaceParent() bool { return *s.ReplaceParent } +// GetSubIssueID returns the SubIssueID field. +func (s *SubIssueRequest) GetSubIssueID() int64 { + if s == nil { + return 0 + } + return s.SubIssueID +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *Subscription) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -28798,6 +37846,14 @@ func (s *Subscription) GetURL() string { return *s.URL } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (s *SystemRequirements) GetNodes() []*SystemRequirementsNode { + if s == nil || s.Nodes == nil { + return nil + } + return s.Nodes +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SystemRequirements) GetStatus() string { if s == nil || s.Status == nil { @@ -28814,6 +37870,14 @@ func (s *SystemRequirementsNode) GetHostname() string { return *s.Hostname } +// GetRolesStatus returns the RolesStatus slice if it's non-nil, nil otherwise. +func (s *SystemRequirementsNode) GetRolesStatus() []*SystemRequirementsNodeRoleStatus { + if s == nil || s.RolesStatus == nil { + return nil + } + return s.RolesStatus +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SystemRequirementsNode) GetStatus() string { if s == nil || s.Status == nil { @@ -29110,6 +38174,14 @@ func (t *Team) GetSlug() string { return *t.Slug } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (t *Team) GetType() string { + if t == nil || t.Type == nil { + return "" + } + return *t.Type +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (t *Team) GetURL() string { if t == nil || t.URL == nil { @@ -29158,6 +38230,22 @@ func (t *TeamAddEvent) GetTeam() *Team { return t.Team } +// GetRole returns the Role field. +func (t *TeamAddTeamMembershipOptions) GetRole() string { + if t == nil { + return "" + } + return t.Role +} + +// GetPermission returns the Permission field. +func (t *TeamAddTeamRepoOptions) GetPermission() string { + if t == nil { + return "" + } + return t.Permission +} + // GetDescription returns the Description field. func (t *TeamChange) GetDescription() *TeamDescription { if t == nil { @@ -29478,6 +38566,14 @@ func (t *TeamLDAPMapping) GetURL() string { return *t.URL } +// GetRole returns the Role field. +func (t *TeamListTeamMembersOptions) GetRole() string { + if t == nil { + return "" + } + return t.Role +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (t *TeamName) GetFrom() string { if t == nil || t.From == nil { @@ -29590,6 +38686,14 @@ func (t *TextMatch) GetFragment() string { return *t.Fragment } +// GetMatches returns the Matches slice if it's non-nil, nil otherwise. +func (t *TextMatch) GetMatches() []*Match { + if t == nil || t.Matches == nil { + return nil + } + return t.Matches +} + // GetObjectType returns the ObjectType field if it's non-nil, zero value otherwise. func (t *TextMatch) GetObjectType() string { if t == nil || t.ObjectType == nil { @@ -29726,6 +38830,14 @@ func (t *Timeline) GetMilestone() *Milestone { return t.Milestone } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (t *Timeline) GetParents() []*Commit { + if t == nil || t.Parents == nil { + return nil + } + return t.Parents +} + // GetPerformedViaGithubApp returns the PerformedViaGithubApp field. func (t *Timeline) GetPerformedViaGithubApp() *App { if t == nil { @@ -29894,12 +39006,12 @@ func (t *TopicResult) GetName() string { return *t.Name } -// GetScore returns the Score field. -func (t *TopicResult) GetScore() *float64 { - if t == nil { - return nil +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (t *TopicResult) GetScore() float64 { + if t == nil || t.Score == nil { + return 0 } - return t.Score + return *t.Score } // GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise. @@ -29926,6 +39038,14 @@ func (t *TopicsSearchResult) GetIncompleteResults() bool { return *t.IncompleteResults } +// GetTopics returns the Topics slice if it's non-nil, nil otherwise. +func (t *TopicsSearchResult) GetTopics() []*TopicResult { + if t == nil || t.Topics == nil { + return nil + } + return t.Topics +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (t *TopicsSearchResult) GetTotal() int { if t == nil || t.Total == nil { @@ -29934,6 +39054,38 @@ func (t *TopicsSearchResult) GetTotal() int { return *t.Total } +// GetTotalActiveCachesCount returns the TotalActiveCachesCount field. +func (t *TotalCacheUsage) GetTotalActiveCachesCount() int { + if t == nil { + return 0 + } + return t.TotalActiveCachesCount +} + +// GetTotalActiveCachesUsageSizeInBytes returns the TotalActiveCachesUsageSizeInBytes field. +func (t *TotalCacheUsage) GetTotalActiveCachesUsageSizeInBytes() int64 { + if t == nil { + return 0 + } + return t.TotalActiveCachesUsageSizeInBytes +} + +// GetPer returns the Per field. +func (t *TrafficBreakdownOptions) GetPer() string { + if t == nil { + return "" + } + return t.Per +} + +// GetClones returns the Clones slice if it's non-nil, nil otherwise. +func (t *TrafficClones) GetClones() []*TrafficData { + if t == nil || t.Clones == nil { + return nil + } + return t.Clones +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (t *TrafficClones) GetCount() int { if t == nil || t.Count == nil { @@ -30046,6 +39198,14 @@ func (t *TrafficViews) GetUniques() int { return *t.Uniques } +// GetViews returns the Views slice if it's non-nil, nil otherwise. +func (t *TrafficViews) GetViews() []*TrafficData { + if t == nil || t.Views == nil { + return nil + } + return t.Views +} + // GetNewName returns the NewName field if it's non-nil, zero value otherwise. func (t *TransferRequest) GetNewName() string { if t == nil || t.NewName == nil { @@ -30054,6 +39214,30 @@ func (t *TransferRequest) GetNewName() string { return *t.NewName } +// GetNewOwner returns the NewOwner field. +func (t *TransferRequest) GetNewOwner() string { + if t == nil { + return "" + } + return t.NewOwner +} + +// GetTeamID returns the TeamID slice if it's non-nil, nil otherwise. +func (t *TransferRequest) GetTeamID() []int64 { + if t == nil || t.TeamID == nil { + return nil + } + return t.TeamID +} + +// GetEntries returns the Entries slice if it's non-nil, nil otherwise. +func (t *Tree) GetEntries() []*TreeEntry { + if t == nil || t.Entries == nil { + return nil + } + return t.Entries +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (t *Tree) GetSHA() string { if t == nil || t.SHA == nil { @@ -30126,6 +39310,22 @@ func (t *TreeEntry) GetURL() string { return *t.URL } +// GetClientID returns the ClientID field. +func (u *UnauthenticatedRateLimitedTransport) GetClientID() string { + if u == nil { + return "" + } + return u.ClientID +} + +// GetClientSecret returns the ClientSecret field. +func (u *UnauthenticatedRateLimitedTransport) GetClientSecret() string { + if u == nil { + return "" + } + return u.ClientSecret +} + // GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. func (u *UpdateAppInstallationRepositoriesOptions) GetRepositorySelection() string { if u == nil || u.RepositorySelection == nil { @@ -30134,6 +39334,22 @@ func (u *UpdateAppInstallationRepositoriesOptions) GetRepositorySelection() stri return *u.RepositorySelection } +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (u *UpdateAppInstallationRepositoriesOptions) GetSelectedRepositoryIDs() []int64 { + if u == nil || u.SelectedRepositoryIDs == nil { + return nil + } + return u.SelectedRepositoryIDs +} + +// GetOp returns the Op field. +func (u *UpdateAttributeForSCIMUserOperations) GetOp() string { + if u == nil { + return "" + } + return u.Op +} + // GetPath returns the Path field if it's non-nil, zero value otherwise. func (u *UpdateAttributeForSCIMUserOperations) GetPath() string { if u == nil || u.Path == nil { @@ -30142,6 +39358,46 @@ func (u *UpdateAttributeForSCIMUserOperations) GetPath() string { return *u.Path } +// GetValue returns the Value field. +func (u *UpdateAttributeForSCIMUserOperations) GetValue() json.RawMessage { + if u == nil { + return json.RawMessage{} + } + return u.Value +} + +// GetOperations returns the Operations field. +func (u *UpdateAttributeForSCIMUserOptions) GetOperations() UpdateAttributeForSCIMUserOperations { + if u == nil { + return UpdateAttributeForSCIMUserOperations{} + } + return u.Operations +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (u *UpdateAttributeForSCIMUserOptions) GetSchemas() []string { + if u == nil || u.Schemas == nil { + return nil + } + return u.Schemas +} + +// GetParameters returns the Parameters field. +func (u *UpdateBranchRule) GetParameters() UpdateRuleParameters { + if u == nil { + return UpdateRuleParameters{} + } + return u.Parameters +} + +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (u *UpdateCheckRunOptions) GetActions() []*CheckRunAction { + if u == nil || u.Actions == nil { + return nil + } + return u.Actions +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (u *UpdateCheckRunOptions) GetCompletedAt() Timestamp { if u == nil || u.CompletedAt == nil { @@ -30174,6 +39430,14 @@ func (u *UpdateCheckRunOptions) GetExternalID() string { return *u.ExternalID } +// GetName returns the Name field. +func (u *UpdateCheckRunOptions) GetName() string { + if u == nil { + return "" + } + return u.Name +} + // GetOutput returns the Output field. func (u *UpdateCheckRunOptions) GetOutput() *CheckRunOutput { if u == nil { @@ -30198,6 +39462,54 @@ func (u *UpdateCodespaceOptions) GetMachine() string { return *u.Machine } +// GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise. +func (u *UpdateCodespaceOptions) GetRecentFolders() []string { + if u == nil || u.RecentFolders == nil { + return nil + } + return u.RecentFolders +} + +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (u *UpdateCustomOrgRoleRequest) GetBaseRole() string { + if u == nil || u.BaseRole == nil { + return "" + } + return *u.BaseRole +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (u *UpdateCustomOrgRoleRequest) GetDescription() string { + if u == nil || u.Description == nil { + return "" + } + return *u.Description +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (u *UpdateCustomOrgRoleRequest) GetName() string { + if u == nil || u.Name == nil { + return "" + } + return *u.Name +} + +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (u *UpdateCustomOrgRoleRequest) GetPermissions() []string { + if u == nil || u.Permissions == nil { + return nil + } + return u.Permissions +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (u *UpdateDefaultSetupConfigurationOptions) GetLanguages() []string { + if u == nil || u.Languages == nil { + return nil + } + return u.Languages +} + // GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. func (u *UpdateDefaultSetupConfigurationOptions) GetQuerySuite() string { if u == nil || u.QuerySuite == nil { @@ -30206,6 +39518,14 @@ func (u *UpdateDefaultSetupConfigurationOptions) GetQuerySuite() string { return *u.QuerySuite } +// GetState returns the State field. +func (u *UpdateDefaultSetupConfigurationOptions) GetState() string { + if u == nil { + return "" + } + return u.State +} + // GetRunID returns the RunID field if it's non-nil, zero value otherwise. func (u *UpdateDefaultSetupConfigurationResponse) GetRunID() int64 { if u == nil || u.RunID == nil { @@ -30238,6 +39558,14 @@ func (u *UpdateEnterpriseRunnerGroupRequest) GetName() string { return *u.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) GetNetworkConfigurationID() string { + if u == nil || u.NetworkConfigurationID == nil { + return "" + } + return *u.NetworkConfigurationID +} + // GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. func (u *UpdateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { if u == nil || u.RestrictedToWorkflows == nil { @@ -30246,6 +39574,14 @@ func (u *UpdateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *u.RestrictedToWorkflows } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) GetSelectedWorkflows() []string { + if u == nil || u.SelectedWorkflows == nil { + return nil + } + return u.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (u *UpdateEnterpriseRunnerGroupRequest) GetVisibility() string { if u == nil || u.Visibility == nil { @@ -30254,6 +39590,62 @@ func (u *UpdateEnterpriseRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetEnableStaticIP returns the EnableStaticIP field if it's non-nil, zero value otherwise. +func (u *UpdateHostedRunnerRequest) GetEnableStaticIP() bool { + if u == nil || u.EnableStaticIP == nil { + return false + } + return *u.EnableStaticIP +} + +// GetImageID returns the ImageID field if it's non-nil, zero value otherwise. +func (u *UpdateHostedRunnerRequest) GetImageID() string { + if u == nil || u.ImageID == nil { + return "" + } + return *u.ImageID +} + +// GetImageVersion returns the ImageVersion field if it's non-nil, zero value otherwise. +func (u *UpdateHostedRunnerRequest) GetImageVersion() string { + if u == nil || u.ImageVersion == nil { + return "" + } + return *u.ImageVersion +} + +// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise. +func (u *UpdateHostedRunnerRequest) GetMaximumRunners() int64 { + if u == nil || u.MaximumRunners == nil { + return 0 + } + return *u.MaximumRunners +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (u *UpdateHostedRunnerRequest) GetName() string { + if u == nil || u.Name == nil { + return "" + } + return *u.Name +} + +// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. +func (u *UpdateHostedRunnerRequest) GetRunnerGroupID() int64 { + if u == nil || u.RunnerGroupID == nil { + return 0 + } + return *u.RunnerGroupID +} + +// GetSize returns the Size field if it's non-nil, zero value otherwise. +func (u *UpdateHostedRunnerRequest) GetSize() string { + if u == nil || u.Size == nil { + return "" + } + return *u.Size +} + // GetEncryptedValue returns the EncryptedValue field if it's non-nil, zero value otherwise. func (u *UpdateOrganizationPrivateRegistry) GetEncryptedValue() string { if u == nil || u.EncryptedValue == nil { @@ -30278,6 +39670,14 @@ func (u *UpdateOrganizationPrivateRegistry) GetRegistryType() string { return *u.RegistryType } +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetSelectedRepositoryIDs() []int64 { + if u == nil || u.SelectedRepositoryIDs == nil { + return nil + } + return u.SelectedRepositoryIDs +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (u *UpdateOrganizationPrivateRegistry) GetURL() string { if u == nil || u.URL == nil { @@ -30310,6 +39710,30 @@ func (u *UpdateProjectItemOptions) GetArchived() bool { return *u.Archived } +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (u *UpdateProjectItemOptions) GetFields() []*UpdateProjectV2Field { + if u == nil || u.Fields == nil { + return nil + } + return u.Fields +} + +// GetID returns the ID field. +func (u *UpdateProjectV2Field) GetID() int64 { + if u == nil { + return 0 + } + return u.ID +} + +// GetValue returns the Value field. +func (u *UpdateProjectV2Field) GetValue() any { + if u == nil { + return nil + } + return u.Value +} + // GetForce returns the Force field if it's non-nil, zero value otherwise. func (u *UpdateRef) GetForce() bool { if u == nil || u.Force == nil { @@ -30318,6 +39742,22 @@ func (u *UpdateRef) GetForce() bool { return *u.Force } +// GetSHA returns the SHA field. +func (u *UpdateRef) GetSHA() string { + if u == nil { + return "" + } + return u.SHA +} + +// GetUpdateAllowsFetchAndMerge returns the UpdateAllowsFetchAndMerge field. +func (u *UpdateRuleParameters) GetUpdateAllowsFetchAndMerge() bool { + if u == nil { + return false + } + return u.UpdateAllowsFetchAndMerge +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetAllowsPublicRepositories() bool { if u == nil || u.AllowsPublicRepositories == nil { @@ -30350,6 +39790,14 @@ func (u *UpdateRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *u.RestrictedToWorkflows } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (u *UpdateRunnerGroupRequest) GetSelectedWorkflows() []string { + if u == nil || u.SelectedWorkflows == nil { + return nil + } + return u.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetVisibility() string { if u == nil || u.Visibility == nil { @@ -30358,6 +39806,70 @@ func (u *UpdateRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetLicense returns the License field. +func (u *UploadLicenseOptions) GetLicense() string { + if u == nil { + return "" + } + return u.License +} + +// GetLabel returns the Label field. +func (u *UploadOptions) GetLabel() string { + if u == nil { + return "" + } + return u.Label +} + +// GetMediaType returns the MediaType field. +func (u *UploadOptions) GetMediaType() string { + if u == nil { + return "" + } + return u.MediaType +} + +// GetName returns the Name field. +func (u *UploadOptions) GetName() string { + if u == nil { + return "" + } + return u.Name +} + +// GetDate returns the Date field. +func (u *UsageItem) GetDate() string { + if u == nil { + return "" + } + return u.Date +} + +// GetDiscountAmount returns the DiscountAmount field. +func (u *UsageItem) GetDiscountAmount() float64 { + if u == nil { + return 0 + } + return u.DiscountAmount +} + +// GetGrossAmount returns the GrossAmount field. +func (u *UsageItem) GetGrossAmount() float64 { + if u == nil { + return 0 + } + return u.GrossAmount +} + +// GetNetAmount returns the NetAmount field. +func (u *UsageItem) GetNetAmount() float64 { + if u == nil { + return 0 + } + return u.NetAmount +} + // GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise. func (u *UsageItem) GetOrganizationName() string { if u == nil || u.OrganizationName == nil { @@ -30366,6 +39878,30 @@ func (u *UsageItem) GetOrganizationName() string { return *u.OrganizationName } +// GetPricePerUnit returns the PricePerUnit field. +func (u *UsageItem) GetPricePerUnit() float64 { + if u == nil { + return 0 + } + return u.PricePerUnit +} + +// GetProduct returns the Product field. +func (u *UsageItem) GetProduct() string { + if u == nil { + return "" + } + return u.Product +} + +// GetQuantity returns the Quantity field. +func (u *UsageItem) GetQuantity() float64 { + if u == nil { + return 0 + } + return u.Quantity +} + // GetRepositoryName returns the RepositoryName field if it's non-nil, zero value otherwise. func (u *UsageItem) GetRepositoryName() string { if u == nil || u.RepositoryName == nil { @@ -30374,6 +39910,30 @@ func (u *UsageItem) GetRepositoryName() string { return *u.RepositoryName } +// GetSKU returns the SKU field. +func (u *UsageItem) GetSKU() string { + if u == nil { + return "" + } + return u.SKU +} + +// GetUnitType returns the UnitType field. +func (u *UsageItem) GetUnitType() string { + if u == nil { + return "" + } + return u.UnitType +} + +// GetUsageItems returns the UsageItems slice if it's non-nil, nil otherwise. +func (u *UsageReport) GetUsageItems() []*UsageItem { + if u == nil || u.UsageItems == nil { + return nil + } + return u.UsageItems +} + // GetDay returns the Day field if it's non-nil, zero value otherwise. func (u *UsageReportOptions) GetDay() int { if u == nil || u.Day == nil { @@ -30438,6 +39998,14 @@ func (u *User) GetBlog() string { return *u.Blog } +// GetBusinessPlus returns the BusinessPlus field if it's non-nil, zero value otherwise. +func (u *User) GetBusinessPlus() bool { + if u == nil || u.BusinessPlus == nil { + return false + } + return *u.BusinessPlus +} + // GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise. func (u *User) GetCollaborators() int { if u == nil || u.Collaborators == nil { @@ -30558,6 +40126,14 @@ func (u *User) GetID() int64 { return *u.ID } +// GetInheritedFrom returns the InheritedFrom slice if it's non-nil, nil otherwise. +func (u *User) GetInheritedFrom() []*Team { + if u == nil || u.InheritedFrom == nil { + return nil + } + return u.InheritedFrom +} + // GetLdapDn returns the LdapDn field if it's non-nil, zero value otherwise. func (u *User) GetLdapDn() string { if u == nil || u.LdapDn == nil { @@ -30598,6 +40174,14 @@ func (u *User) GetNodeID() string { return *u.NodeID } +// GetNotificationEmail returns the NotificationEmail field if it's non-nil, zero value otherwise. +func (u *User) GetNotificationEmail() string { + if u == nil || u.NotificationEmail == nil { + return "" + } + return *u.NotificationEmail +} + // GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise. func (u *User) GetOrganizationsURL() string { if u == nil || u.OrganizationsURL == nil { @@ -30614,10 +40198,10 @@ func (u *User) GetOwnedPrivateRepos() int64 { return *u.OwnedPrivateRepos } -// GetPermissions returns the Permissions map if it's non-nil, an empty map otherwise. -func (u *User) GetPermissions() map[string]bool { - if u == nil || u.Permissions == nil { - return map[string]bool{} +// GetPermissions returns the Permissions field. +func (u *User) GetPermissions() *RepositoryPermissions { + if u == nil { + return nil } return u.Permissions } @@ -30710,6 +40294,14 @@ func (u *User) GetSuspendedAt() Timestamp { return *u.SuspendedAt } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (u *User) GetTextMatches() []*TextMatch { + if u == nil || u.TextMatches == nil { + return nil + } + return u.TextMatches +} + // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. func (u *User) GetTotalPrivateRepos() int64 { if u == nil || u.TotalPrivateRepos == nil { @@ -30758,6 +40350,14 @@ func (u *User) GetURL() string { return *u.URL } +// GetUserViewType returns the UserViewType field if it's non-nil, zero value otherwise. +func (u *User) GetUserViewType() string { + if u == nil || u.UserViewType == nil { + return "" + } + return *u.UserViewType +} + // GetApp returns the App field. func (u *UserAuthorization) GetApp() *OAuthAPP { if u == nil { @@ -30814,6 +40414,14 @@ func (u *UserAuthorization) GetNoteURL() string { return *u.NoteURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (u *UserAuthorization) GetScopes() []string { + if u == nil || u.Scopes == nil { + return nil + } + return u.Scopes +} + // GetToken returns the Token field if it's non-nil, zero value otherwise. func (u *UserAuthorization) GetToken() string { if u == nil || u.Token == nil { @@ -31070,6 +40678,22 @@ func (u *UserLDAPMapping) GetURL() string { return *u.URL } +// GetPerPage returns the PerPage field. +func (u *UserListOptions) GetPerPage() int { + if u == nil { + return 0 + } + return u.PerPage +} + +// GetSince returns the Since field. +func (u *UserListOptions) GetSince() int64 { + if u == nil { + return 0 + } + return u.Since +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (u *UserMigration) GetCreatedAt() string { if u == nil || u.CreatedAt == nil { @@ -31110,6 +40734,14 @@ func (u *UserMigration) GetLockRepositories() bool { return *u.LockRepositories } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (u *UserMigration) GetRepositories() []*Repository { + if u == nil || u.Repositories == nil { + return nil + } + return u.Repositories +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (u *UserMigration) GetState() string { if u == nil || u.State == nil { @@ -31134,6 +40766,22 @@ func (u *UserMigration) GetURL() string { return *u.URL } +// GetExcludeAttachments returns the ExcludeAttachments field. +func (u *UserMigrationOptions) GetExcludeAttachments() bool { + if u == nil { + return false + } + return u.ExcludeAttachments +} + +// GetLockRepositories returns the LockRepositories field. +func (u *UserMigrationOptions) GetLockRepositories() bool { + if u == nil { + return false + } + return u.LockRepositories +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (u *UsersSearchResult) GetIncompleteResults() bool { if u == nil || u.IncompleteResults == nil { @@ -31150,6 +40798,14 @@ func (u *UsersSearchResult) GetTotal() int { return *u.Total } +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (u *UsersSearchResult) GetUsers() []*User { + if u == nil || u.Users == nil { + return nil + } + return u.Users +} + // GetAdminUsers returns the AdminUsers field if it's non-nil, zero value otherwise. func (u *UserStats) GetAdminUsers() int { if u == nil || u.AdminUsers == nil { @@ -31238,6 +40894,14 @@ func (w *WatchEvent) GetSender() *User { return w.Sender } +// GetDays returns the Days slice if it's non-nil, nil otherwise. +func (w *WeeklyCommitActivity) GetDays() []int { + if w == nil || w.Days == nil { + return nil + } + return w.Days +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (w *WeeklyCommitActivity) GetTotal() int { if w == nil || w.Total == nil { @@ -31374,6 +41038,14 @@ func (w *WorkflowBill) GetTotalMS() int64 { return *w.TotalMS } +// GetInputs returns the Inputs field. +func (w *WorkflowDispatchEvent) GetInputs() json.RawMessage { + if w == nil { + return json.RawMessage{} + } + return w.Inputs +} + // GetInstallation returns the Installation field. func (w *WorkflowDispatchEvent) GetInstallation() *Installation { if w == nil { @@ -31422,6 +41094,30 @@ func (w *WorkflowDispatchEvent) GetWorkflow() string { return *w.Workflow } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (w *WorkflowDispatchRunDetails) GetHTMLURL() string { + if w == nil || w.HTMLURL == nil { + return "" + } + return *w.HTMLURL +} + +// GetRunURL returns the RunURL field if it's non-nil, zero value otherwise. +func (w *WorkflowDispatchRunDetails) GetRunURL() string { + if w == nil || w.RunURL == nil { + return "" + } + return *w.RunURL +} + +// GetWorkflowRunID returns the WorkflowRunID field if it's non-nil, zero value otherwise. +func (w *WorkflowDispatchRunDetails) GetWorkflowRunID() int64 { + if w == nil || w.WorkflowRunID == nil { + return 0 + } + return *w.WorkflowRunID +} + // GetCheckRunURL returns the CheckRunURL field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetCheckRunURL() string { if w == nil || w.CheckRunURL == nil { @@ -31486,6 +41182,14 @@ func (w *WorkflowJob) GetID() int64 { return *w.ID } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (w *WorkflowJob) GetLabels() []string { + if w == nil || w.Labels == nil { + return nil + } + return w.Labels +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetName() string { if w == nil || w.Name == nil { @@ -31574,6 +41278,14 @@ func (w *WorkflowJob) GetStatus() string { return *w.Status } +// GetSteps returns the Steps slice if it's non-nil, nil otherwise. +func (w *WorkflowJob) GetSteps() []*TaskStep { + if w == nil || w.Steps == nil { + return nil + } + return w.Steps +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetURL() string { if w == nil || w.URL == nil { @@ -31886,6 +41598,22 @@ func (w *WorkflowRun) GetPreviousAttemptURL() string { return *w.PreviousAttemptURL } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (w *WorkflowRun) GetPullRequests() []*PullRequest { + if w == nil || w.PullRequests == nil { + return nil + } + return w.PullRequests +} + +// GetReferencedWorkflows returns the ReferencedWorkflows slice if it's non-nil, nil otherwise. +func (w *WorkflowRun) GetReferencedWorkflows() []*ReferencedWorkflow { + if w == nil || w.ReferencedWorkflows == nil { + return nil + } + return w.ReferencedWorkflows +} + // GetRepository returns the Repository field. func (w *WorkflowRun) GetRepository() *Repository { if w == nil { @@ -31982,6 +41710,14 @@ func (w *WorkflowRunAttemptOptions) GetExcludePullRequests() bool { return *w.ExcludePullRequests } +// GetJobRuns returns the JobRuns slice if it's non-nil, nil otherwise. +func (w *WorkflowRunBill) GetJobRuns() []*WorkflowRunJobRun { + if w == nil || w.JobRuns == nil { + return nil + } + return w.JobRuns +} + // GetJobs returns the Jobs field if it's non-nil, zero value otherwise. func (w *WorkflowRunBill) GetJobs() int { if w == nil || w.Jobs == nil { @@ -32078,6 +41814,14 @@ func (w *WorkflowRuns) GetTotalCount() int { return *w.TotalCount } +// GetWorkflowRuns returns the WorkflowRuns slice if it's non-nil, nil otherwise. +func (w *WorkflowRuns) GetWorkflowRuns() []*WorkflowRun { + if w == nil || w.WorkflowRuns == nil { + return nil + } + return w.WorkflowRuns +} + // GetBillable returns the Billable field. func (w *WorkflowRunUsage) GetBillable() *WorkflowRunBillMap { if w == nil { @@ -32102,6 +41846,22 @@ func (w *Workflows) GetTotalCount() int { return *w.TotalCount } +// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise. +func (w *Workflows) GetWorkflows() []*Workflow { + if w == nil || w.Workflows == nil { + return nil + } + return w.Workflows +} + +// GetParameters returns the Parameters field. +func (w *WorkflowsBranchRule) GetParameters() WorkflowsRuleParameters { + if w == nil { + return WorkflowsRuleParameters{} + } + return w.Parameters +} + // GetRequireApprovalForForkPRWorkflows returns the RequireApprovalForForkPRWorkflows field if it's non-nil, zero value otherwise. func (w *WorkflowsPermissions) GetRequireApprovalForForkPRWorkflows() bool { if w == nil || w.RequireApprovalForForkPRWorkflows == nil { @@ -32142,6 +41902,14 @@ func (w *WorkflowsPermissionsOpt) GetRequireApprovalForForkPRWorkflows() bool { return *w.RequireApprovalForForkPRWorkflows } +// GetRunWorkflowsFromForkPullRequests returns the RunWorkflowsFromForkPullRequests field. +func (w *WorkflowsPermissionsOpt) GetRunWorkflowsFromForkPullRequests() bool { + if w == nil { + return false + } + return w.RunWorkflowsFromForkPullRequests +} + // GetSendSecretsAndVariables returns the SendSecretsAndVariables field if it's non-nil, zero value otherwise. func (w *WorkflowsPermissionsOpt) GetSendSecretsAndVariables() bool { if w == nil || w.SendSecretsAndVariables == nil { @@ -32166,6 +41934,14 @@ func (w *WorkflowsRuleParameters) GetDoNotEnforceOnCreate() bool { return *w.DoNotEnforceOnCreate } +// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise. +func (w *WorkflowsRuleParameters) GetWorkflows() []*RuleWorkflow { + if w == nil || w.Workflows == nil { + return nil + } + return w.Workflows +} + // GetBillable returns the Billable field. func (w *WorkflowUsage) GetBillable() *WorkflowBillMap { if w == nil { diff --git a/vendor/github.com/google/go-github/v85/github/github-iterators.go b/vendor/github.com/google/go-github/v85/github/github-iterators.go new file mode 100644 index 000000000..5568ca792 --- /dev/null +++ b/vendor/github.com/google/go-github/v85/github/github-iterators.go @@ -0,0 +1,7530 @@ +// Code generated by gen-iterators; DO NOT EDIT. +// Instead, please run "go generate ./..." as described here: +// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch + +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "iter" +) + +// ListArtifactsIter returns an iterator that paginates through all results of ListArtifacts. +func (s *ActionsService) ListArtifactsIter(ctx context.Context, owner string, repo string, opts *ListArtifactsOptions) iter.Seq2[*Artifact, error] { + return func(yield func(*Artifact, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListArtifactsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListArtifacts(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Artifact + if results != nil { + iterItems = results.Artifacts + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCacheUsageByRepoForOrgIter returns an iterator that paginates through all results of ListCacheUsageByRepoForOrg. +func (s *ActionsService) ListCacheUsageByRepoForOrgIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*ActionsCacheUsage, error] { + return func(yield func(*ActionsCacheUsage, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCacheUsageByRepoForOrg(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*ActionsCacheUsage + if results != nil { + iterItems = results.RepoCacheUsage + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCachesIter returns an iterator that paginates through all results of ListCaches. +func (s *ActionsService) ListCachesIter(ctx context.Context, owner string, repo string, opts *ActionsCacheListOptions) iter.Seq2[*ActionsCache, error] { + return func(yield func(*ActionsCache, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ActionsCacheListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCaches(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*ActionsCache + if results != nil { + iterItems = results.ActionsCaches + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListEnabledOrgsInEnterpriseIter returns an iterator that paginates through all results of ListEnabledOrgsInEnterprise. +func (s *ActionsService) ListEnabledOrgsInEnterpriseIter(ctx context.Context, owner string, opts *ListOptions) iter.Seq2[*Organization, error] { + return func(yield func(*Organization, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEnabledOrgsInEnterprise(ctx, owner, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Organization + if results != nil { + iterItems = results.Organizations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEnabledReposInOrgIter returns an iterator that paginates through all results of ListEnabledReposInOrg. +func (s *ActionsService) ListEnabledReposInOrgIter(ctx context.Context, owner string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEnabledReposInOrg(ctx, owner, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEnvSecretsIter returns an iterator that paginates through all results of ListEnvSecrets. +func (s *ActionsService) ListEnvSecretsIter(ctx context.Context, repoID int, env string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEnvSecrets(ctx, repoID, env, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEnvVariablesIter returns an iterator that paginates through all results of ListEnvVariables. +func (s *ActionsService) ListEnvVariablesIter(ctx context.Context, owner string, repo string, env string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] { + return func(yield func(*ActionsVariable, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEnvVariables(ctx, owner, repo, env, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*ActionsVariable + if results != nil { + iterItems = results.Variables + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListHostedRunnersIter returns an iterator that paginates through all results of ListHostedRunners. +func (s *ActionsService) ListHostedRunnersIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*HostedRunner, error] { + return func(yield func(*HostedRunner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListHostedRunners(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*HostedRunner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets. +func (s *ActionsService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrgSecrets(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrgVariablesIter returns an iterator that paginates through all results of ListOrgVariables. +func (s *ActionsService) ListOrgVariablesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] { + return func(yield func(*ActionsVariable, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrgVariables(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*ActionsVariable + if results != nil { + iterItems = results.Variables + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrganizationRunnerGroupsIter returns an iterator that paginates through all results of ListOrganizationRunnerGroups. +func (s *ActionsService) ListOrganizationRunnerGroupsIter(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) iter.Seq2[*RunnerGroup, error] { + return func(yield func(*RunnerGroup, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOrgRunnerGroupOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationRunnerGroups(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*RunnerGroup + if results != nil { + iterItems = results.RunnerGroups + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListOrganizationRunnersIter returns an iterator that paginates through all results of ListOrganizationRunners. +func (s *ActionsService) ListOrganizationRunnersIter(ctx context.Context, org string, opts *ListRunnersOptions) iter.Seq2[*Runner, error] { + return func(yield func(*Runner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListRunnersOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationRunners(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Runner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListRepoOrgSecretsIter returns an iterator that paginates through all results of ListRepoOrgSecrets. +func (s *ActionsService) ListRepoOrgSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepoOrgSecrets(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepoOrgVariablesIter returns an iterator that paginates through all results of ListRepoOrgVariables. +func (s *ActionsService) ListRepoOrgVariablesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] { + return func(yield func(*ActionsVariable, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepoOrgVariables(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*ActionsVariable + if results != nil { + iterItems = results.Variables + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets. +func (s *ActionsService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepoSecrets(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepoVariablesIter returns an iterator that paginates through all results of ListRepoVariables. +func (s *ActionsService) ListRepoVariablesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] { + return func(yield func(*ActionsVariable, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepoVariables(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*ActionsVariable + if results != nil { + iterItems = results.Variables + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter returns an iterator that paginates through all results of ListRepositoriesSelfHostedRunnersAllowedInOrganization. +func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepositoryAccessRunnerGroupIter returns an iterator that paginates through all results of ListRepositoryAccessRunnerGroup. +func (s *ActionsService) ListRepositoryAccessRunnerGroupIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoryAccessRunnerGroup(ctx, org, groupID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepositoryWorkflowRunsIter returns an iterator that paginates through all results of ListRepositoryWorkflowRuns. +func (s *ActionsService) ListRepositoryWorkflowRunsIter(ctx context.Context, owner string, repo string, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error] { + return func(yield func(*WorkflowRun, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListWorkflowRunsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoryWorkflowRuns(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*WorkflowRun + if results != nil { + iterItems = results.WorkflowRuns + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListRunnerGroupHostedRunnersIter returns an iterator that paginates through all results of ListRunnerGroupHostedRunners. +func (s *ActionsService) ListRunnerGroupHostedRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*HostedRunner, error] { + return func(yield func(*HostedRunner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRunnerGroupHostedRunners(ctx, org, groupID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*HostedRunner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRunnerGroupRunnersIter returns an iterator that paginates through all results of ListRunnerGroupRunners. +func (s *ActionsService) ListRunnerGroupRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*Runner, error] { + return func(yield func(*Runner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRunnerGroupRunners(ctx, org, groupID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Runner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRunnersIter returns an iterator that paginates through all results of ListRunners. +func (s *ActionsService) ListRunnersIter(ctx context.Context, owner string, repo string, opts *ListRunnersOptions) iter.Seq2[*Runner, error] { + return func(yield func(*Runner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListRunnersOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRunners(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Runner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret. +func (s *ActionsService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListSelectedReposForOrgSecret(ctx, org, name, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListSelectedReposForOrgVariableIter returns an iterator that paginates through all results of ListSelectedReposForOrgVariable. +func (s *ActionsService) ListSelectedReposForOrgVariableIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListSelectedReposForOrgVariable(ctx, org, name, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListWorkflowJobsIter returns an iterator that paginates through all results of ListWorkflowJobs. +func (s *ActionsService) ListWorkflowJobsIter(ctx context.Context, owner string, repo string, runID int64, opts *ListWorkflowJobsOptions) iter.Seq2[*WorkflowJob, error] { + return func(yield func(*WorkflowJob, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListWorkflowJobsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWorkflowJobs(ctx, owner, repo, runID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*WorkflowJob + if results != nil { + iterItems = results.Jobs + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListWorkflowJobsAttemptIter returns an iterator that paginates through all results of ListWorkflowJobsAttempt. +func (s *ActionsService) ListWorkflowJobsAttemptIter(ctx context.Context, owner string, repo string, runID int64, attemptNumber int64, opts *ListOptions) iter.Seq2[*WorkflowJob, error] { + return func(yield func(*WorkflowJob, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWorkflowJobsAttempt(ctx, owner, repo, runID, attemptNumber, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*WorkflowJob + if results != nil { + iterItems = results.Jobs + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListWorkflowRunArtifactsIter returns an iterator that paginates through all results of ListWorkflowRunArtifacts. +func (s *ActionsService) ListWorkflowRunArtifactsIter(ctx context.Context, owner string, repo string, runID int64, opts *ListOptions) iter.Seq2[*Artifact, error] { + return func(yield func(*Artifact, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWorkflowRunArtifacts(ctx, owner, repo, runID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Artifact + if results != nil { + iterItems = results.Artifacts + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListWorkflowRunsByFileNameIter returns an iterator that paginates through all results of ListWorkflowRunsByFileName. +func (s *ActionsService) ListWorkflowRunsByFileNameIter(ctx context.Context, owner string, repo string, workflowFileName string, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error] { + return func(yield func(*WorkflowRun, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListWorkflowRunsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWorkflowRunsByFileName(ctx, owner, repo, workflowFileName, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*WorkflowRun + if results != nil { + iterItems = results.WorkflowRuns + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListWorkflowRunsByIDIter returns an iterator that paginates through all results of ListWorkflowRunsByID. +func (s *ActionsService) ListWorkflowRunsByIDIter(ctx context.Context, owner string, repo string, workflowID int64, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error] { + return func(yield func(*WorkflowRun, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListWorkflowRunsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWorkflowRunsByID(ctx, owner, repo, workflowID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*WorkflowRun + if results != nil { + iterItems = results.WorkflowRuns + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListWorkflowsIter returns an iterator that paginates through all results of ListWorkflows. +func (s *ActionsService) ListWorkflowsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Workflow, error] { + return func(yield func(*Workflow, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWorkflows(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Workflow + if results != nil { + iterItems = results.Workflows + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEventsIter returns an iterator that paginates through all results of ListEvents. +func (s *ActivityService) ListEventsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Event, error] { + return func(yield func(*Event, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEvents(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEventsForOrganizationIter returns an iterator that paginates through all results of ListEventsForOrganization. +func (s *ActivityService) ListEventsForOrganizationIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Event, error] { + return func(yield func(*Event, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEventsForOrganization(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEventsForRepoNetworkIter returns an iterator that paginates through all results of ListEventsForRepoNetwork. +func (s *ActivityService) ListEventsForRepoNetworkIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Event, error] { + return func(yield func(*Event, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEventsForRepoNetwork(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEventsPerformedByUserIter returns an iterator that paginates through all results of ListEventsPerformedByUser. +func (s *ActivityService) ListEventsPerformedByUserIter(ctx context.Context, user string, publicOnly bool, opts *ListOptions) iter.Seq2[*Event, error] { + return func(yield func(*Event, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEventsPerformedByUser(ctx, user, publicOnly, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEventsReceivedByUserIter returns an iterator that paginates through all results of ListEventsReceivedByUser. +func (s *ActivityService) ListEventsReceivedByUserIter(ctx context.Context, user string, publicOnly bool, opts *ListOptions) iter.Seq2[*Event, error] { + return func(yield func(*Event, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEventsReceivedByUser(ctx, user, publicOnly, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListIssueEventsForRepositoryIter returns an iterator that paginates through all results of ListIssueEventsForRepository. +func (s *ActivityService) ListIssueEventsForRepositoryIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*IssueEvent, error] { + return func(yield func(*IssueEvent, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListIssueEventsForRepository(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListNotificationsIter returns an iterator that paginates through all results of ListNotifications. +func (s *ActivityService) ListNotificationsIter(ctx context.Context, opts *NotificationListOptions) iter.Seq2[*Notification, error] { + return func(yield func(*Notification, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &NotificationListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListNotifications(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents. +func (s *ActivityService) ListRepositoryEventsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Event, error] { + return func(yield func(*Event, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoryEvents(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepositoryNotificationsIter returns an iterator that paginates through all results of ListRepositoryNotifications. +func (s *ActivityService) ListRepositoryNotificationsIter(ctx context.Context, owner string, repo string, opts *NotificationListOptions) iter.Seq2[*Notification, error] { + return func(yield func(*Notification, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &NotificationListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoryNotifications(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListStargazersIter returns an iterator that paginates through all results of ListStargazers. +func (s *ActivityService) ListStargazersIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Stargazer, error] { + return func(yield func(*Stargazer, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListStargazers(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListStarredIter returns an iterator that paginates through all results of ListStarred. +func (s *ActivityService) ListStarredIter(ctx context.Context, user string, opts *ActivityListStarredOptions) iter.Seq2[*StarredRepository, error] { + return func(yield func(*StarredRepository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ActivityListStarredOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListStarred(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListUserEventsForOrganizationIter returns an iterator that paginates through all results of ListUserEventsForOrganization. +func (s *ActivityService) ListUserEventsForOrganizationIter(ctx context.Context, org string, user string, opts *ListOptions) iter.Seq2[*Event, error] { + return func(yield func(*Event, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserEventsForOrganization(ctx, org, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListWatchedIter returns an iterator that paginates through all results of ListWatched. +func (s *ActivityService) ListWatchedIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWatched(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListWatchersIter returns an iterator that paginates through all results of ListWatchers. +func (s *ActivityService) ListWatchersIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListWatchers(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListHookDeliveriesIter returns an iterator that paginates through all results of ListHookDeliveries. +func (s *AppsService) ListHookDeliveriesIter(ctx context.Context, opts *ListCursorOptions) iter.Seq2[*HookDelivery, error] { + return func(yield func(*HookDelivery, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCursorOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListHookDeliveries(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.Cursor == "" { + break + } + opts.Cursor = resp.Cursor + } + } +} + +// ListInstallationRequestsIter returns an iterator that paginates through all results of ListInstallationRequests. +func (s *AppsService) ListInstallationRequestsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*InstallationRequest, error] { + return func(yield func(*InstallationRequest, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListInstallationRequests(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListInstallationsIter returns an iterator that paginates through all results of ListInstallations. +func (s *AppsService) ListInstallationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Installation, error] { + return func(yield func(*Installation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListInstallations(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListReposIter returns an iterator that paginates through all results of ListRepos. +func (s *AppsService) ListReposIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepos(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserInstallationsIter returns an iterator that paginates through all results of ListUserInstallations. +func (s *AppsService) ListUserInstallationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Installation, error] { + return func(yield func(*Installation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserInstallations(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserReposIter returns an iterator that paginates through all results of ListUserRepos. +func (s *AppsService) ListUserReposIter(ctx context.Context, id int64, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserRepos(ctx, id, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCheckRunAnnotationsIter returns an iterator that paginates through all results of ListCheckRunAnnotations. +func (s *ChecksService) ListCheckRunAnnotationsIter(ctx context.Context, owner string, repo string, checkRunID int64, opts *ListOptions) iter.Seq2[*CheckRunAnnotation, error] { + return func(yield func(*CheckRunAnnotation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCheckRunAnnotations(ctx, owner, repo, checkRunID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCheckRunsCheckSuiteIter returns an iterator that paginates through all results of ListCheckRunsCheckSuite. +func (s *ChecksService) ListCheckRunsCheckSuiteIter(ctx context.Context, owner string, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) iter.Seq2[*CheckRun, error] { + return func(yield func(*CheckRun, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCheckRunsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCheckRunsCheckSuite(ctx, owner, repo, checkSuiteID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CheckRun + if results != nil { + iterItems = results.CheckRuns + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCheckRunsForRefIter returns an iterator that paginates through all results of ListCheckRunsForRef. +func (s *ChecksService) ListCheckRunsForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckRunsOptions) iter.Seq2[*CheckRun, error] { + return func(yield func(*CheckRun, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCheckRunsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCheckRunsForRef(ctx, owner, repo, ref, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CheckRun + if results != nil { + iterItems = results.CheckRuns + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCheckSuitesForRefIter returns an iterator that paginates through all results of ListCheckSuitesForRef. +func (s *ChecksService) ListCheckSuitesForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckSuiteOptions) iter.Seq2[*CheckSuite, error] { + return func(yield func(*CheckSuite, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCheckSuiteOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCheckSuitesForRef(ctx, owner, repo, ref, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CheckSuite + if results != nil { + iterItems = results.CheckSuites + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAcceptedAssignmentsIter returns an iterator that paginates through all results of ListAcceptedAssignments. +func (s *ClassroomService) ListAcceptedAssignmentsIter(ctx context.Context, assignmentID int64, opts *ListOptions) iter.Seq2[*AcceptedAssignment, error] { + return func(yield func(*AcceptedAssignment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAcceptedAssignments(ctx, assignmentID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListClassroomAssignmentsIter returns an iterator that paginates through all results of ListClassroomAssignments. +func (s *ClassroomService) ListClassroomAssignmentsIter(ctx context.Context, classroomID int64, opts *ListOptions) iter.Seq2[*ClassroomAssignment, error] { + return func(yield func(*ClassroomAssignment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListClassroomAssignments(ctx, classroomID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListClassroomsIter returns an iterator that paginates through all results of ListClassrooms. +func (s *ClassroomService) ListClassroomsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Classroom, error] { + return func(yield func(*Classroom, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListClassrooms(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAlertInstancesIter returns an iterator that paginates through all results of ListAlertInstances. +func (s *CodeScanningService) ListAlertInstancesIter(ctx context.Context, owner string, repo string, id int64, opts *AlertInstancesListOptions) iter.Seq2[*MostRecentInstance, error] { + return func(yield func(*MostRecentInstance, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &AlertInstancesListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAlertInstances(ctx, owner, repo, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAlertsForOrgIter returns an iterator that paginates through all results of ListAlertsForOrg. +func (s *CodeScanningService) ListAlertsForOrgIter(ctx context.Context, org string, opts *AlertListOptions) iter.Seq2[*Alert, error] { + return func(yield func(*Alert, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &AlertListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAlertsForOrg(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAlertsForRepoIter returns an iterator that paginates through all results of ListAlertsForRepo. +func (s *CodeScanningService) ListAlertsForRepoIter(ctx context.Context, owner string, repo string, opts *AlertListOptions) iter.Seq2[*Alert, error] { + return func(yield func(*Alert, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &AlertListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAlertsForRepo(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAnalysesForRepoIter returns an iterator that paginates through all results of ListAnalysesForRepo. +func (s *CodeScanningService) ListAnalysesForRepoIter(ctx context.Context, owner string, repo string, opts *AnalysesListOptions) iter.Seq2[*ScanningAnalysis, error] { + return func(yield func(*ScanningAnalysis, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &AnalysesListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAnalysesForRepo(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListIter returns an iterator that paginates through all results of List. +func (s *CodespacesService) ListIter(ctx context.Context, opts *ListCodespacesOptions) iter.Seq2[*Codespace, error] { + return func(yield func(*Codespace, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCodespacesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.List(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Codespace + if results != nil { + iterItems = results.Codespaces + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListDevContainerConfigurationsIter returns an iterator that paginates through all results of ListDevContainerConfigurations. +func (s *CodespacesService) ListDevContainerConfigurationsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*DevContainer, error] { + return func(yield func(*DevContainer, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListDevContainerConfigurations(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*DevContainer + if results != nil { + iterItems = results.Devcontainers + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListInOrgIter returns an iterator that paginates through all results of ListInOrg. +func (s *CodespacesService) ListInOrgIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Codespace, error] { + return func(yield func(*Codespace, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListInOrg(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Codespace + if results != nil { + iterItems = results.Codespaces + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListInRepoIter returns an iterator that paginates through all results of ListInRepo. +func (s *CodespacesService) ListInRepoIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Codespace, error] { + return func(yield func(*Codespace, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListInRepo(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Codespace + if results != nil { + iterItems = results.Codespaces + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets. +func (s *CodespacesService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrgSecrets(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets. +func (s *CodespacesService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepoSecrets(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret. +func (s *CodespacesService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListSelectedReposForOrgSecret(ctx, org, name, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListSelectedReposForUserSecretIter returns an iterator that paginates through all results of ListSelectedReposForUserSecret. +func (s *CodespacesService) ListSelectedReposForUserSecretIter(ctx context.Context, name string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListSelectedReposForUserSecret(ctx, name, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserCodespacesInOrgIter returns an iterator that paginates through all results of ListUserCodespacesInOrg. +func (s *CodespacesService) ListUserCodespacesInOrgIter(ctx context.Context, org string, username string, opts *ListOptions) iter.Seq2[*Codespace, error] { + return func(yield func(*Codespace, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserCodespacesInOrg(ctx, org, username, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Codespace + if results != nil { + iterItems = results.Codespaces + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserSecretsIter returns an iterator that paginates through all results of ListUserSecrets. +func (s *CodespacesService) ListUserSecretsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserSecrets(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCopilotEnterpriseSeatsIter returns an iterator that paginates through all results of ListCopilotEnterpriseSeats. +func (s *CopilotService) ListCopilotEnterpriseSeatsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*CopilotSeatDetails, error] { + return func(yield func(*CopilotSeatDetails, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCopilotEnterpriseSeats(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CopilotSeatDetails + if results != nil { + iterItems = results.Seats + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCopilotSeatsIter returns an iterator that paginates through all results of ListCopilotSeats. +func (s *CopilotService) ListCopilotSeatsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*CopilotSeatDetails, error] { + return func(yield func(*CopilotSeatDetails, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCopilotSeats(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CopilotSeatDetails + if results != nil { + iterItems = results.Seats + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrgAlertsIter returns an iterator that paginates through all results of ListOrgAlerts. +func (s *DependabotService) ListOrgAlertsIter(ctx context.Context, org string, opts *ListAlertsOptions) iter.Seq2[*DependabotAlert, error] { + return func(yield func(*DependabotAlert, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListAlertsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrgAlerts(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets. +func (s *DependabotService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrgSecrets(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepoAlertsIter returns an iterator that paginates through all results of ListRepoAlerts. +func (s *DependabotService) ListRepoAlertsIter(ctx context.Context, owner string, repo string, opts *ListAlertsOptions) iter.Seq2[*DependabotAlert, error] { + return func(yield func(*DependabotAlert, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListAlertsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepoAlerts(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets. +func (s *DependabotService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] { + return func(yield func(*Secret, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepoSecrets(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Secret + if results != nil { + iterItems = results.Secrets + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret. +func (s *DependabotService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListSelectedReposForOrgSecret(ctx, org, name, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAppAccessibleOrganizationRepositoriesIter returns an iterator that paginates through all results of ListAppAccessibleOrganizationRepositories. +func (s *EnterpriseService) ListAppAccessibleOrganizationRepositoriesIter(ctx context.Context, enterprise string, org string, opts *ListOptions) iter.Seq2[*AccessibleRepository, error] { + return func(yield func(*AccessibleRepository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAppAccessibleOrganizationRepositories(ctx, enterprise, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAppInstallableOrganizationsIter returns an iterator that paginates through all results of ListAppInstallableOrganizations. +func (s *EnterpriseService) ListAppInstallableOrganizationsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*InstallableOrganization, error] { + return func(yield func(*InstallableOrganization, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAppInstallableOrganizations(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAppInstallationsIter returns an iterator that paginates through all results of ListAppInstallations. +func (s *EnterpriseService) ListAppInstallationsIter(ctx context.Context, enterprise string, org string, opts *ListOptions) iter.Seq2[*Installation, error] { + return func(yield func(*Installation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAppInstallations(ctx, enterprise, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAssignmentsIter returns an iterator that paginates through all results of ListAssignments. +func (s *EnterpriseService) ListAssignmentsIter(ctx context.Context, enterprise string, enterpriseTeam string, opts *ListOptions) iter.Seq2[*Organization, error] { + return func(yield func(*Organization, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAssignments(ctx, enterprise, enterpriseTeam, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCodeSecurityConfigurationRepositoriesIter returns an iterator that paginates through all results of ListCodeSecurityConfigurationRepositories. +func (s *EnterpriseService) ListCodeSecurityConfigurationRepositoriesIter(ctx context.Context, enterprise string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) iter.Seq2[*RepositoryAttachment, error] { + return func(yield func(*RepositoryAttachment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCodeSecurityConfigurationRepositoriesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCodeSecurityConfigurationRepositories(ctx, enterprise, configurationID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListCodeSecurityConfigurationsIter returns an iterator that paginates through all results of ListCodeSecurityConfigurations. +func (s *EnterpriseService) ListCodeSecurityConfigurationsIter(ctx context.Context, enterprise string, opts *ListEnterpriseCodeSecurityConfigurationOptions) iter.Seq2[*CodeSecurityConfiguration, error] { + return func(yield func(*CodeSecurityConfiguration, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListEnterpriseCodeSecurityConfigurationOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCodeSecurityConfigurations(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListEnterpriseNetworkConfigurationsIter returns an iterator that paginates through all results of ListEnterpriseNetworkConfigurations. +func (s *EnterpriseService) ListEnterpriseNetworkConfigurationsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*NetworkConfiguration, error] { + return func(yield func(*NetworkConfiguration, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEnterpriseNetworkConfigurations(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*NetworkConfiguration + if results != nil { + iterItems = results.NetworkConfigurations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListHostedRunnersIter returns an iterator that paginates through all results of ListHostedRunners. +func (s *EnterpriseService) ListHostedRunnersIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*HostedRunner, error] { + return func(yield func(*HostedRunner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListHostedRunners(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*HostedRunner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrganizationAccessRunnerGroupIter returns an iterator that paginates through all results of ListOrganizationAccessRunnerGroup. +func (s *EnterpriseService) ListOrganizationAccessRunnerGroupIter(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) iter.Seq2[*Organization, error] { + return func(yield func(*Organization, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationAccessRunnerGroup(ctx, enterprise, groupID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Organization + if results != nil { + iterItems = results.Organizations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrganizationCustomPropertyValuesIter returns an iterator that paginates through all results of ListOrganizationCustomPropertyValues. +func (s *EnterpriseService) ListOrganizationCustomPropertyValuesIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*EnterpriseCustomPropertiesValues, error] { + return func(yield func(*EnterpriseCustomPropertiesValues, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationCustomPropertyValues(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepositoriesForOrgAppInstallationIter returns an iterator that paginates through all results of ListRepositoriesForOrgAppInstallation. +func (s *EnterpriseService) ListRepositoriesForOrgAppInstallationIter(ctx context.Context, enterprise string, org string, installationID int64, opts *ListOptions) iter.Seq2[*AccessibleRepository, error] { + return func(yield func(*AccessibleRepository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoriesForOrgAppInstallation(ctx, enterprise, org, installationID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRunnerGroupRunnersIter returns an iterator that paginates through all results of ListRunnerGroupRunners. +func (s *EnterpriseService) ListRunnerGroupRunnersIter(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) iter.Seq2[*Runner, error] { + return func(yield func(*Runner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRunnerGroupRunners(ctx, enterprise, groupID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Runner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRunnerGroupsIter returns an iterator that paginates through all results of ListRunnerGroups. +func (s *EnterpriseService) ListRunnerGroupsIter(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) iter.Seq2[*EnterpriseRunnerGroup, error] { + return func(yield func(*EnterpriseRunnerGroup, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListEnterpriseRunnerGroupOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRunnerGroups(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*EnterpriseRunnerGroup + if results != nil { + iterItems = results.RunnerGroups + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListRunnersIter returns an iterator that paginates through all results of ListRunners. +func (s *EnterpriseService) ListRunnersIter(ctx context.Context, enterprise string, opts *ListRunnersOptions) iter.Seq2[*Runner, error] { + return func(yield func(*Runner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListRunnersOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRunners(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Runner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListTeamMembersIter returns an iterator that paginates through all results of ListTeamMembers. +func (s *EnterpriseService) ListTeamMembersIter(ctx context.Context, enterprise string, enterpriseTeam string, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamMembers(ctx, enterprise, enterpriseTeam, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListTeamsIter returns an iterator that paginates through all results of ListTeams. +func (s *EnterpriseService) ListTeamsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*EnterpriseTeam, error] { + return func(yield func(*EnterpriseTeam, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeams(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListIter returns an iterator that paginates through all results of List. +func (s *GistsService) ListIter(ctx context.Context, user string, opts *GistListOptions) iter.Seq2[*Gist, error] { + return func(yield func(*Gist, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &GistListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.List(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAllIter returns an iterator that paginates through all results of ListAll. +func (s *GistsService) ListAllIter(ctx context.Context, opts *GistListOptions) iter.Seq2[*Gist, error] { + return func(yield func(*Gist, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &GistListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAll(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCommentsIter returns an iterator that paginates through all results of ListComments. +func (s *GistsService) ListCommentsIter(ctx context.Context, gistID string, opts *ListOptions) iter.Seq2[*GistComment, error] { + return func(yield func(*GistComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListComments(ctx, gistID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCommitsIter returns an iterator that paginates through all results of ListCommits. +func (s *GistsService) ListCommitsIter(ctx context.Context, id string, opts *ListOptions) iter.Seq2[*GistCommit, error] { + return func(yield func(*GistCommit, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCommits(ctx, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListForksIter returns an iterator that paginates through all results of ListForks. +func (s *GistsService) ListForksIter(ctx context.Context, id string, opts *ListOptions) iter.Seq2[*GistFork, error] { + return func(yield func(*GistFork, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListForks(ctx, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListStarredIter returns an iterator that paginates through all results of ListStarred. +func (s *GistsService) ListStarredIter(ctx context.Context, opts *GistListOptions) iter.Seq2[*Gist, error] { + return func(yield func(*Gist, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &GistListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListStarred(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAllIssuesIter returns an iterator that paginates through all results of ListAllIssues. +func (s *IssuesService) ListAllIssuesIter(ctx context.Context, opts *ListAllIssuesOptions) iter.Seq2[*Issue, error] { + return func(yield func(*Issue, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListAllIssuesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAllIssues(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAssigneesIter returns an iterator that paginates through all results of ListAssignees. +func (s *IssuesService) ListAssigneesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAssignees(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListByOrgIter returns an iterator that paginates through all results of ListByOrg. +func (s *IssuesService) ListByOrgIter(ctx context.Context, org string, opts *IssueListByOrgOptions) iter.Seq2[*Issue, error] { + return func(yield func(*Issue, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &IssueListByOrgOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListByOrg(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListByRepoIter returns an iterator that paginates through all results of ListByRepo. +func (s *IssuesService) ListByRepoIter(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) iter.Seq2[*Issue, error] { + return func(yield func(*Issue, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &IssueListByRepoOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListByRepo(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCommentsIter returns an iterator that paginates through all results of ListComments. +func (s *IssuesService) ListCommentsIter(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) iter.Seq2[*IssueComment, error] { + return func(yield func(*IssueComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &IssueListCommentsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListComments(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListIssueEventsIter returns an iterator that paginates through all results of ListIssueEvents. +func (s *IssuesService) ListIssueEventsIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*IssueEvent, error] { + return func(yield func(*IssueEvent, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListIssueEvents(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListIssueTimelineIter returns an iterator that paginates through all results of ListIssueTimeline. +func (s *IssuesService) ListIssueTimelineIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Timeline, error] { + return func(yield func(*Timeline, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListIssueTimeline(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListLabelsIter returns an iterator that paginates through all results of ListLabels. +func (s *IssuesService) ListLabelsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Label, error] { + return func(yield func(*Label, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListLabels(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListLabelsByIssueIter returns an iterator that paginates through all results of ListLabelsByIssue. +func (s *IssuesService) ListLabelsByIssueIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Label, error] { + return func(yield func(*Label, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListLabelsByIssue(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListLabelsForMilestoneIter returns an iterator that paginates through all results of ListLabelsForMilestone. +func (s *IssuesService) ListLabelsForMilestoneIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Label, error] { + return func(yield func(*Label, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListLabelsForMilestone(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListMilestonesIter returns an iterator that paginates through all results of ListMilestones. +func (s *IssuesService) ListMilestonesIter(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) iter.Seq2[*Milestone, error] { + return func(yield func(*Milestone, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &MilestoneListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListMilestones(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents. +func (s *IssuesService) ListRepositoryEventsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*IssueEvent, error] { + return func(yield func(*IssueEvent, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoryEvents(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserIssuesIter returns an iterator that paginates through all results of ListUserIssues. +func (s *IssuesService) ListUserIssuesIter(ctx context.Context, opts *ListUserIssuesOptions) iter.Seq2[*Issue, error] { + return func(yield func(*Issue, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListUserIssuesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserIssues(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListIter returns an iterator that paginates through all results of List. +func (s *LicensesService) ListIter(ctx context.Context, opts *ListLicensesOptions) iter.Seq2[*License, error] { + return func(yield func(*License, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListLicensesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.List(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListMarketplacePurchasesForUserIter returns an iterator that paginates through all results of ListMarketplacePurchasesForUser. +func (s *MarketplaceService) ListMarketplacePurchasesForUserIter(ctx context.Context, opts *ListOptions) iter.Seq2[*MarketplacePurchase, error] { + return func(yield func(*MarketplacePurchase, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListMarketplacePurchasesForUser(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListPlanAccountsForPlanIter returns an iterator that paginates through all results of ListPlanAccountsForPlan. +func (s *MarketplaceService) ListPlanAccountsForPlanIter(ctx context.Context, planID int64, opts *ListOptions) iter.Seq2[*MarketplacePlanAccount, error] { + return func(yield func(*MarketplacePlanAccount, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPlanAccountsForPlan(ctx, planID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListPlansIter returns an iterator that paginates through all results of ListPlans. +func (s *MarketplaceService) ListPlansIter(ctx context.Context, opts *ListOptions) iter.Seq2[*MarketplacePlan, error] { + return func(yield func(*MarketplacePlan, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPlans(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListMigrationsIter returns an iterator that paginates through all results of ListMigrations. +func (s *MigrationService) ListMigrationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Migration, error] { + return func(yield func(*Migration, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListMigrations(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserMigrationsIter returns an iterator that paginates through all results of ListUserMigrations. +func (s *MigrationService) ListUserMigrationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*UserMigration, error] { + return func(yield func(*UserMigration, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserMigrations(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListIter returns an iterator that paginates through all results of List. +func (s *OrganizationsService) ListIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*Organization, error] { + return func(yield func(*Organization, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.List(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAttestationsIter returns an iterator that paginates through all results of ListAttestations. +func (s *OrganizationsService) ListAttestationsIter(ctx context.Context, org string, subjectDigest string, opts *ListOptions) iter.Seq2[*Attestation, error] { + return func(yield func(*Attestation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAttestations(ctx, org, subjectDigest, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Attestation + if results != nil { + iterItems = results.Attestations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListBlockedUsersIter returns an iterator that paginates through all results of ListBlockedUsers. +func (s *OrganizationsService) ListBlockedUsersIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListBlockedUsers(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCodeSecurityConfigurationRepositoriesIter returns an iterator that paginates through all results of ListCodeSecurityConfigurationRepositories. +func (s *OrganizationsService) ListCodeSecurityConfigurationRepositoriesIter(ctx context.Context, org string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) iter.Seq2[*RepositoryAttachment, error] { + return func(yield func(*RepositoryAttachment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCodeSecurityConfigurationRepositoriesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCodeSecurityConfigurationRepositories(ctx, org, configurationID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListCodeSecurityConfigurationsIter returns an iterator that paginates through all results of ListCodeSecurityConfigurations. +func (s *OrganizationsService) ListCodeSecurityConfigurationsIter(ctx context.Context, org string, opts *ListOrgCodeSecurityConfigurationOptions) iter.Seq2[*CodeSecurityConfiguration, error] { + return func(yield func(*CodeSecurityConfiguration, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOrgCodeSecurityConfigurationOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCodeSecurityConfigurations(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListCredentialAuthorizationsIter returns an iterator that paginates through all results of ListCredentialAuthorizations. +func (s *OrganizationsService) ListCredentialAuthorizationsIter(ctx context.Context, org string, opts *CredentialAuthorizationsListOptions) iter.Seq2[*CredentialAuthorization, error] { + return func(yield func(*CredentialAuthorization, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &CredentialAuthorizationsListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCredentialAuthorizations(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCustomPropertyValuesIter returns an iterator that paginates through all results of ListCustomPropertyValues. +func (s *OrganizationsService) ListCustomPropertyValuesIter(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) iter.Seq2[*RepoCustomPropertyValue, error] { + return func(yield func(*RepoCustomPropertyValue, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCustomPropertyValuesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCustomPropertyValues(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListFailedOrgInvitationsIter returns an iterator that paginates through all results of ListFailedOrgInvitations. +func (s *OrganizationsService) ListFailedOrgInvitationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Invitation, error] { + return func(yield func(*Invitation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListFailedOrgInvitations(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListFineGrainedPersonalAccessTokenRequestsIter returns an iterator that paginates through all results of ListFineGrainedPersonalAccessTokenRequests. +func (s *OrganizationsService) ListFineGrainedPersonalAccessTokenRequestsIter(ctx context.Context, org string, opts *ListFineGrainedPATOptions) iter.Seq2[*FineGrainedPersonalAccessTokenRequest, error] { + return func(yield func(*FineGrainedPersonalAccessTokenRequest, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListFineGrainedPATOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListFineGrainedPersonalAccessTokenRequests(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListFineGrainedPersonalAccessTokensIter returns an iterator that paginates through all results of ListFineGrainedPersonalAccessTokens. +func (s *OrganizationsService) ListFineGrainedPersonalAccessTokensIter(ctx context.Context, org string, opts *ListFineGrainedPATOptions) iter.Seq2[*PersonalAccessToken, error] { + return func(yield func(*PersonalAccessToken, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListFineGrainedPATOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListFineGrainedPersonalAccessTokens(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListHookDeliveriesIter returns an iterator that paginates through all results of ListHookDeliveries. +func (s *OrganizationsService) ListHookDeliveriesIter(ctx context.Context, org string, id int64, opts *ListCursorOptions) iter.Seq2[*HookDelivery, error] { + return func(yield func(*HookDelivery, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCursorOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListHookDeliveries(ctx, org, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.Cursor == "" { + break + } + opts.Cursor = resp.Cursor + } + } +} + +// ListHooksIter returns an iterator that paginates through all results of ListHooks. +func (s *OrganizationsService) ListHooksIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Hook, error] { + return func(yield func(*Hook, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListHooks(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListImmutableReleaseRepositoriesIter returns an iterator that paginates through all results of ListImmutableReleaseRepositories. +func (s *OrganizationsService) ListImmutableReleaseRepositoriesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListImmutableReleaseRepositories(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListInstallationsIter returns an iterator that paginates through all results of ListInstallations. +func (s *OrganizationsService) ListInstallationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Installation, error] { + return func(yield func(*Installation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListInstallations(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Installation + if results != nil { + iterItems = results.Installations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListMembersIter returns an iterator that paginates through all results of ListMembers. +func (s *OrganizationsService) ListMembersIter(ctx context.Context, org string, opts *ListMembersOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListMembersOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListMembers(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListNetworkConfigurationsIter returns an iterator that paginates through all results of ListNetworkConfigurations. +func (s *OrganizationsService) ListNetworkConfigurationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*NetworkConfiguration, error] { + return func(yield func(*NetworkConfiguration, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListNetworkConfigurations(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*NetworkConfiguration + if results != nil { + iterItems = results.NetworkConfigurations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrgInvitationTeamsIter returns an iterator that paginates through all results of ListOrgInvitationTeams. +func (s *OrganizationsService) ListOrgInvitationTeamsIter(ctx context.Context, org string, invitationID string, opts *ListOptions) iter.Seq2[*Team, error] { + return func(yield func(*Team, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrgInvitationTeams(ctx, org, invitationID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrgMembershipsIter returns an iterator that paginates through all results of ListOrgMemberships. +func (s *OrganizationsService) ListOrgMembershipsIter(ctx context.Context, opts *ListOrgMembershipsOptions) iter.Seq2[*Membership, error] { + return func(yield func(*Membership, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOrgMembershipsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrgMemberships(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListOutsideCollaboratorsIter returns an iterator that paginates through all results of ListOutsideCollaborators. +func (s *OrganizationsService) ListOutsideCollaboratorsIter(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOutsideCollaboratorsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOutsideCollaborators(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListPackagesIter returns an iterator that paginates through all results of ListPackages. +func (s *OrganizationsService) ListPackagesIter(ctx context.Context, org string, opts *PackageListOptions) iter.Seq2[*Package, error] { + return func(yield func(*Package, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &PackageListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPackages(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListPendingOrgInvitationsIter returns an iterator that paginates through all results of ListPendingOrgInvitations. +func (s *OrganizationsService) ListPendingOrgInvitationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Invitation, error] { + return func(yield func(*Invitation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPendingOrgInvitations(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListTeamsAssignedToOrgRoleIter returns an iterator that paginates through all results of ListTeamsAssignedToOrgRole. +func (s *OrganizationsService) ListTeamsAssignedToOrgRoleIter(ctx context.Context, org string, roleID int64, opts *ListOptions) iter.Seq2[*Team, error] { + return func(yield func(*Team, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamsAssignedToOrgRole(ctx, org, roleID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUsersAssignedToOrgRoleIter returns an iterator that paginates through all results of ListUsersAssignedToOrgRole. +func (s *OrganizationsService) ListUsersAssignedToOrgRoleIter(ctx context.Context, org string, roleID int64, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUsersAssignedToOrgRole(ctx, org, roleID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrganizationPrivateRegistriesIter returns an iterator that paginates through all results of ListOrganizationPrivateRegistries. +func (s *PrivateRegistriesService) ListOrganizationPrivateRegistriesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*PrivateRegistry, error] { + return func(yield func(*PrivateRegistry, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationPrivateRegistries(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*PrivateRegistry + if results != nil { + iterItems = results.Configurations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListOrganizationProjectFieldsIter returns an iterator that paginates through all results of ListOrganizationProjectFields. +func (s *ProjectsService) ListOrganizationProjectFieldsIter(ctx context.Context, org string, projectNumber int, opts *ListProjectsOptions) iter.Seq2[*ProjectV2Field, error] { + return func(yield func(*ProjectV2Field, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListProjectsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationProjectFields(ctx, org, projectNumber, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListOrganizationProjectItemsIter returns an iterator that paginates through all results of ListOrganizationProjectItems. +func (s *ProjectsService) ListOrganizationProjectItemsIter(ctx context.Context, org string, projectNumber int, opts *ListProjectItemsOptions) iter.Seq2[*ProjectV2Item, error] { + return func(yield func(*ProjectV2Item, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListProjectItemsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationProjectItems(ctx, org, projectNumber, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListOrganizationProjectsIter returns an iterator that paginates through all results of ListOrganizationProjects. +func (s *ProjectsService) ListOrganizationProjectsIter(ctx context.Context, org string, opts *ListProjectsOptions) iter.Seq2[*ProjectV2, error] { + return func(yield func(*ProjectV2, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListProjectsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationProjects(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListUserProjectFieldsIter returns an iterator that paginates through all results of ListUserProjectFields. +func (s *ProjectsService) ListUserProjectFieldsIter(ctx context.Context, user string, projectNumber int, opts *ListProjectsOptions) iter.Seq2[*ProjectV2Field, error] { + return func(yield func(*ProjectV2Field, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListProjectsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserProjectFields(ctx, user, projectNumber, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListUserProjectItemsIter returns an iterator that paginates through all results of ListUserProjectItems. +func (s *ProjectsService) ListUserProjectItemsIter(ctx context.Context, username string, projectNumber int, opts *ListProjectItemsOptions) iter.Seq2[*ProjectV2Item, error] { + return func(yield func(*ProjectV2Item, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListProjectItemsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserProjectItems(ctx, username, projectNumber, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListUserProjectsIter returns an iterator that paginates through all results of ListUserProjects. +func (s *ProjectsService) ListUserProjectsIter(ctx context.Context, username string, opts *ListProjectsOptions) iter.Seq2[*ProjectV2, error] { + return func(yield func(*ProjectV2, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListProjectsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserProjects(ctx, username, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListIter returns an iterator that paginates through all results of List. +func (s *PullRequestsService) ListIter(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) iter.Seq2[*PullRequest, error] { + return func(yield func(*PullRequest, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &PullRequestListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.List(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCommentsIter returns an iterator that paginates through all results of ListComments. +func (s *PullRequestsService) ListCommentsIter(ctx context.Context, owner string, repo string, number int, opts *PullRequestListCommentsOptions) iter.Seq2[*PullRequestComment, error] { + return func(yield func(*PullRequestComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &PullRequestListCommentsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListComments(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCommitsIter returns an iterator that paginates through all results of ListCommits. +func (s *PullRequestsService) ListCommitsIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*RepositoryCommit, error] { + return func(yield func(*RepositoryCommit, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCommits(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListFilesIter returns an iterator that paginates through all results of ListFiles. +func (s *PullRequestsService) ListFilesIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*CommitFile, error] { + return func(yield func(*CommitFile, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListFiles(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListPullRequestsWithCommitIter returns an iterator that paginates through all results of ListPullRequestsWithCommit. +func (s *PullRequestsService) ListPullRequestsWithCommitIter(ctx context.Context, owner string, repo string, sha string, opts *ListOptions) iter.Seq2[*PullRequest, error] { + return func(yield func(*PullRequest, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPullRequestsWithCommit(ctx, owner, repo, sha, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListReviewCommentsIter returns an iterator that paginates through all results of ListReviewComments. +func (s *PullRequestsService) ListReviewCommentsIter(ctx context.Context, owner string, repo string, number int, reviewID int64, opts *ListOptions) iter.Seq2[*PullRequestComment, error] { + return func(yield func(*PullRequestComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListReviewComments(ctx, owner, repo, number, reviewID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListReviewsIter returns an iterator that paginates through all results of ListReviews. +func (s *PullRequestsService) ListReviewsIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*PullRequestReview, error] { + return func(yield func(*PullRequestReview, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListReviews(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCommentReactionsIter returns an iterator that paginates through all results of ListCommentReactions. +func (s *ReactionsService) ListCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { + return func(yield func(*Reaction, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListReactionOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCommentReactions(ctx, owner, repo, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListIssueCommentReactionsIter returns an iterator that paginates through all results of ListIssueCommentReactions. +func (s *ReactionsService) ListIssueCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { + return func(yield func(*Reaction, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListReactionOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListIssueCommentReactions(ctx, owner, repo, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListIssueReactionsIter returns an iterator that paginates through all results of ListIssueReactions. +func (s *ReactionsService) ListIssueReactionsIter(ctx context.Context, owner string, repo string, number int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { + return func(yield func(*Reaction, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListReactionOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListIssueReactions(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListPullRequestCommentReactionsIter returns an iterator that paginates through all results of ListPullRequestCommentReactions. +func (s *ReactionsService) ListPullRequestCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { + return func(yield func(*Reaction, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListReactionOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPullRequestCommentReactions(ctx, owner, repo, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListReleaseReactionsIter returns an iterator that paginates through all results of ListReleaseReactions. +func (s *ReactionsService) ListReleaseReactionsIter(ctx context.Context, owner string, repo string, releaseID int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { + return func(yield func(*Reaction, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListReactionOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListReleaseReactions(ctx, owner, repo, releaseID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListTeamDiscussionCommentReactionsIter returns an iterator that paginates through all results of ListTeamDiscussionCommentReactions. +func (s *ReactionsService) ListTeamDiscussionCommentReactionsIter(ctx context.Context, teamID int64, discussionNumber int, commentNumber int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { + return func(yield func(*Reaction, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListReactionOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamDiscussionCommentReactions(ctx, teamID, discussionNumber, commentNumber, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListTeamDiscussionReactionsIter returns an iterator that paginates through all results of ListTeamDiscussionReactions. +func (s *ReactionsService) ListTeamDiscussionReactionsIter(ctx context.Context, teamID int64, discussionNumber int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { + return func(yield func(*Reaction, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListReactionOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamDiscussionReactions(ctx, teamID, discussionNumber, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCommitComparisonFilesIter returns an iterator that paginates through all results of CompareCommits. +func (s *RepositoriesService) ListCommitComparisonFilesIter(ctx context.Context, owner string, repo string, base string, head string, opts *ListOptions) iter.Seq2[*CommitFile, error] { + return func(yield func(*CommitFile, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.CompareCommits(ctx, owner, repo, base, head, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CommitFile + if results != nil { + iterItems = results.Files + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCombinedStatusIter returns an iterator that paginates through all results of GetCombinedStatus. +func (s *RepositoriesService) ListCombinedStatusIter(ctx context.Context, owner string, repo string, ref string, opts *ListOptions) iter.Seq2[*RepoStatus, error] { + return func(yield func(*RepoStatus, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.GetCombinedStatus(ctx, owner, repo, ref, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*RepoStatus + if results != nil { + iterItems = results.Statuses + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCommitFilesIter returns an iterator that paginates through all results of GetCommit. +func (s *RepositoriesService) ListCommitFilesIter(ctx context.Context, owner string, repo string, sha string, opts *ListOptions) iter.Seq2[*CommitFile, error] { + return func(yield func(*CommitFile, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.GetCommit(ctx, owner, repo, sha, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CommitFile + if results != nil { + iterItems = results.Files + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListIter returns an iterator that paginates through all results of List. +func (s *RepositoriesService) ListIter(ctx context.Context, user string, opts *RepositoryListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &RepositoryListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.List(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAllTopicsIter returns an iterator that paginates through all results of ListAllTopics. +func (s *RepositoriesService) ListAllTopicsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[string, error] { + return func(yield func(string, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAllTopics(ctx, owner, repo, opts) + if err != nil { + yield(*new(string), err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAttestationsIter returns an iterator that paginates through all results of ListAttestations. +func (s *RepositoriesService) ListAttestationsIter(ctx context.Context, owner string, repo string, subjectDigest string, opts *ListOptions) iter.Seq2[*Attestation, error] { + return func(yield func(*Attestation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAttestations(ctx, owner, repo, subjectDigest, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Attestation + if results != nil { + iterItems = results.Attestations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListBranchesIter returns an iterator that paginates through all results of ListBranches. +func (s *RepositoriesService) ListBranchesIter(ctx context.Context, owner string, repo string, opts *BranchListOptions) iter.Seq2[*Branch, error] { + return func(yield func(*Branch, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &BranchListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListBranches(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListByAuthenticatedUserIter returns an iterator that paginates through all results of ListByAuthenticatedUser. +func (s *RepositoriesService) ListByAuthenticatedUserIter(ctx context.Context, opts *RepositoryListByAuthenticatedUserOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &RepositoryListByAuthenticatedUserOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListByAuthenticatedUser(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListByOrgIter returns an iterator that paginates through all results of ListByOrg. +func (s *RepositoriesService) ListByOrgIter(ctx context.Context, org string, opts *RepositoryListByOrgOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &RepositoryListByOrgOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListByOrg(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListByUserIter returns an iterator that paginates through all results of ListByUser. +func (s *RepositoriesService) ListByUserIter(ctx context.Context, user string, opts *RepositoryListByUserOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &RepositoryListByUserOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListByUser(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCollaboratorsIter returns an iterator that paginates through all results of ListCollaborators. +func (s *RepositoriesService) ListCollaboratorsIter(ctx context.Context, owner string, repo string, opts *ListCollaboratorsOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCollaboratorsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCollaborators(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCommentsIter returns an iterator that paginates through all results of ListComments. +func (s *RepositoriesService) ListCommentsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryComment, error] { + return func(yield func(*RepositoryComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListComments(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCommitCommentsIter returns an iterator that paginates through all results of ListCommitComments. +func (s *RepositoriesService) ListCommitCommentsIter(ctx context.Context, owner string, repo string, sha string, opts *ListOptions) iter.Seq2[*RepositoryComment, error] { + return func(yield func(*RepositoryComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCommitComments(ctx, owner, repo, sha, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCommitsIter returns an iterator that paginates through all results of ListCommits. +func (s *RepositoriesService) ListCommitsIter(ctx context.Context, owner string, repo string, opts *CommitsListOptions) iter.Seq2[*RepositoryCommit, error] { + return func(yield func(*RepositoryCommit, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &CommitsListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCommits(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListContributorsIter returns an iterator that paginates through all results of ListContributors. +func (s *RepositoriesService) ListContributorsIter(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) iter.Seq2[*Contributor, error] { + return func(yield func(*Contributor, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListContributorsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListContributors(ctx, owner, repository, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListCustomDeploymentRuleIntegrationsIter returns an iterator that paginates through all results of ListCustomDeploymentRuleIntegrations. +func (s *RepositoriesService) ListCustomDeploymentRuleIntegrationsIter(ctx context.Context, owner string, repo string, environment string, opts *ListOptions) iter.Seq2[*CustomDeploymentProtectionRuleApp, error] { + return func(yield func(*CustomDeploymentProtectionRuleApp, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListCustomDeploymentRuleIntegrations(ctx, owner, repo, environment, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CustomDeploymentProtectionRuleApp + if results != nil { + iterItems = results.AvailableIntegrations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListDeploymentBranchPoliciesIter returns an iterator that paginates through all results of ListDeploymentBranchPolicies. +func (s *RepositoriesService) ListDeploymentBranchPoliciesIter(ctx context.Context, owner string, repo string, environment string, opts *ListOptions) iter.Seq2[*DeploymentBranchPolicy, error] { + return func(yield func(*DeploymentBranchPolicy, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListDeploymentBranchPolicies(ctx, owner, repo, environment, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*DeploymentBranchPolicy + if results != nil { + iterItems = results.BranchPolicies + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListDeploymentStatusesIter returns an iterator that paginates through all results of ListDeploymentStatuses. +func (s *RepositoriesService) ListDeploymentStatusesIter(ctx context.Context, owner string, repo string, deployment int64, opts *ListOptions) iter.Seq2[*DeploymentStatus, error] { + return func(yield func(*DeploymentStatus, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListDeploymentStatuses(ctx, owner, repo, deployment, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListDeploymentsIter returns an iterator that paginates through all results of ListDeployments. +func (s *RepositoriesService) ListDeploymentsIter(ctx context.Context, owner string, repo string, opts *DeploymentsListOptions) iter.Seq2[*Deployment, error] { + return func(yield func(*Deployment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &DeploymentsListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListDeployments(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListEnvironmentsIter returns an iterator that paginates through all results of ListEnvironments. +func (s *RepositoriesService) ListEnvironmentsIter(ctx context.Context, owner string, repo string, opts *EnvironmentListOptions) iter.Seq2[*Environment, error] { + return func(yield func(*Environment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &EnvironmentListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEnvironments(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Environment + if results != nil { + iterItems = results.Environments + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListForksIter returns an iterator that paginates through all results of ListForks. +func (s *RepositoriesService) ListForksIter(ctx context.Context, owner string, repo string, opts *RepositoryListForksOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &RepositoryListForksOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListForks(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListHookDeliveriesIter returns an iterator that paginates through all results of ListHookDeliveries. +func (s *RepositoriesService) ListHookDeliveriesIter(ctx context.Context, owner string, repo string, id int64, opts *ListCursorOptions) iter.Seq2[*HookDelivery, error] { + return func(yield func(*HookDelivery, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListCursorOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListHookDeliveries(ctx, owner, repo, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.Cursor == "" { + break + } + opts.Cursor = resp.Cursor + } + } +} + +// ListHooksIter returns an iterator that paginates through all results of ListHooks. +func (s *RepositoriesService) ListHooksIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Hook, error] { + return func(yield func(*Hook, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListHooks(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListInvitationsIter returns an iterator that paginates through all results of ListInvitations. +func (s *RepositoriesService) ListInvitationsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryInvitation, error] { + return func(yield func(*RepositoryInvitation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListInvitations(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListKeysIter returns an iterator that paginates through all results of ListKeys. +func (s *RepositoriesService) ListKeysIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Key, error] { + return func(yield func(*Key, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListKeys(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListPagesBuildsIter returns an iterator that paginates through all results of ListPagesBuilds. +func (s *RepositoriesService) ListPagesBuildsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*PagesBuild, error] { + return func(yield func(*PagesBuild, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPagesBuilds(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListPreReceiveHooksIter returns an iterator that paginates through all results of ListPreReceiveHooks. +func (s *RepositoriesService) ListPreReceiveHooksIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*PreReceiveHook, error] { + return func(yield func(*PreReceiveHook, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPreReceiveHooks(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListReleaseAssetsIter returns an iterator that paginates through all results of ListReleaseAssets. +func (s *RepositoriesService) ListReleaseAssetsIter(ctx context.Context, owner string, repo string, id int64, opts *ListOptions) iter.Seq2[*ReleaseAsset, error] { + return func(yield func(*ReleaseAsset, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListReleaseAssets(ctx, owner, repo, id, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListReleasesIter returns an iterator that paginates through all results of ListReleases. +func (s *RepositoriesService) ListReleasesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryRelease, error] { + return func(yield func(*RepositoryRelease, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListReleases(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListRepositoryActivitiesIter returns an iterator that paginates through all results of ListRepositoryActivities. +func (s *RepositoriesService) ListRepositoryActivitiesIter(ctx context.Context, owner string, repo string, opts *ListRepositoryActivityOptions) iter.Seq2[*RepositoryActivity, error] { + return func(yield func(*RepositoryActivity, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListRepositoryActivityOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositoryActivities(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.After = resp.After + } + } +} + +// ListStatusesIter returns an iterator that paginates through all results of ListStatuses. +func (s *RepositoriesService) ListStatusesIter(ctx context.Context, owner string, repo string, ref string, opts *ListOptions) iter.Seq2[*RepoStatus, error] { + return func(yield func(*RepoStatus, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListStatuses(ctx, owner, repo, ref, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListTagsIter returns an iterator that paginates through all results of ListTags. +func (s *RepositoriesService) ListTagsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryTag, error] { + return func(yield func(*RepositoryTag, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTags(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListTeamsIter returns an iterator that paginates through all results of ListTeams. +func (s *RepositoriesService) ListTeamsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Team, error] { + return func(yield func(*Team, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeams(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAlertsForEnterpriseIter returns an iterator that paginates through all results of ListAlertsForEnterprise. +func (s *SecretScanningService) ListAlertsForEnterpriseIter(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) iter.Seq2[*SecretScanningAlert, error] { + return func(yield func(*SecretScanningAlert, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &SecretScanningAlertListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAlertsForEnterprise(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAlertsForOrgIter returns an iterator that paginates through all results of ListAlertsForOrg. +func (s *SecretScanningService) ListAlertsForOrgIter(ctx context.Context, org string, opts *SecretScanningAlertListOptions) iter.Seq2[*SecretScanningAlert, error] { + return func(yield func(*SecretScanningAlert, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &SecretScanningAlertListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAlertsForOrg(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListAlertsForRepoIter returns an iterator that paginates through all results of ListAlertsForRepo. +func (s *SecretScanningService) ListAlertsForRepoIter(ctx context.Context, owner string, repo string, opts *SecretScanningAlertListOptions) iter.Seq2[*SecretScanningAlert, error] { + return func(yield func(*SecretScanningAlert, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &SecretScanningAlertListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAlertsForRepo(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" && resp.NextPage == 0 { + break + } + opts.ListCursorOptions.After = resp.After + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListLocationsForAlertIter returns an iterator that paginates through all results of ListLocationsForAlert. +func (s *SecretScanningService) ListLocationsForAlertIter(ctx context.Context, owner string, repo string, number int64, opts *ListOptions) iter.Seq2[*SecretScanningAlertLocation, error] { + return func(yield func(*SecretScanningAlertLocation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListLocationsForAlert(ctx, owner, repo, number, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListGlobalSecurityAdvisoriesIter returns an iterator that paginates through all results of ListGlobalSecurityAdvisories. +func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisoriesIter(ctx context.Context, opts *ListGlobalSecurityAdvisoriesOptions) iter.Seq2[*GlobalSecurityAdvisory, error] { + return func(yield func(*GlobalSecurityAdvisory, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListGlobalSecurityAdvisoriesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListGlobalSecurityAdvisories(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.ListCursorOptions.After = resp.After + } + } +} + +// ListRepositorySecurityAdvisoriesIter returns an iterator that paginates through all results of ListRepositorySecurityAdvisories. +func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesIter(ctx context.Context, owner string, repo string, opts *ListRepositorySecurityAdvisoriesOptions) iter.Seq2[*SecurityAdvisory, error] { + return func(yield func(*SecurityAdvisory, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListRepositorySecurityAdvisoriesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositorySecurityAdvisories(ctx, owner, repo, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.ListCursorOptions.After = resp.After + } + } +} + +// ListRepositorySecurityAdvisoriesForOrgIter returns an iterator that paginates through all results of ListRepositorySecurityAdvisoriesForOrg. +func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrgIter(ctx context.Context, org string, opts *ListRepositorySecurityAdvisoriesOptions) iter.Seq2[*SecurityAdvisory, error] { + return func(yield func(*SecurityAdvisory, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListRepositorySecurityAdvisoriesOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRepositorySecurityAdvisoriesForOrg(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.ListCursorOptions.After = resp.After + } + } +} + +// ListByIssueIter returns an iterator that paginates through all results of ListByIssue. +func (s *SubIssueService) ListByIssueIter(ctx context.Context, owner string, repo string, issueNumber int64, opts *ListOptions) iter.Seq2[*SubIssue, error] { + return func(yield func(*SubIssue, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListByIssue(ctx, owner, repo, issueNumber, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListChildTeamsByParentIDIter returns an iterator that paginates through all results of ListChildTeamsByParentID. +func (s *TeamsService) ListChildTeamsByParentIDIter(ctx context.Context, orgID int64, teamID int64, opts *ListOptions) iter.Seq2[*Team, error] { + return func(yield func(*Team, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListChildTeamsByParentID(ctx, orgID, teamID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListChildTeamsByParentSlugIter returns an iterator that paginates through all results of ListChildTeamsByParentSlug. +func (s *TeamsService) ListChildTeamsByParentSlugIter(ctx context.Context, org string, slug string, opts *ListOptions) iter.Seq2[*Team, error] { + return func(yield func(*Team, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListChildTeamsByParentSlug(ctx, org, slug, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCommentsByIDIter returns an iterator that paginates through all results of ListCommentsByID. +func (s *TeamsService) ListCommentsByIDIter(ctx context.Context, orgID int64, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) iter.Seq2[*DiscussionComment, error] { + return func(yield func(*DiscussionComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if options == nil { + options = &DiscussionCommentListOptions{} + } else { + options = Ptr(*options) + } + + for { + results, resp, err := s.ListCommentsByID(ctx, orgID, teamID, discussionNumber, options) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + options.ListOptions.Page = resp.NextPage + } + } +} + +// ListCommentsBySlugIter returns an iterator that paginates through all results of ListCommentsBySlug. +func (s *TeamsService) ListCommentsBySlugIter(ctx context.Context, org string, slug string, discussionNumber int, options *DiscussionCommentListOptions) iter.Seq2[*DiscussionComment, error] { + return func(yield func(*DiscussionComment, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if options == nil { + options = &DiscussionCommentListOptions{} + } else { + options = Ptr(*options) + } + + for { + results, resp, err := s.ListCommentsBySlug(ctx, org, slug, discussionNumber, options) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + options.ListOptions.Page = resp.NextPage + } + } +} + +// ListDiscussionsByIDIter returns an iterator that paginates through all results of ListDiscussionsByID. +func (s *TeamsService) ListDiscussionsByIDIter(ctx context.Context, orgID int64, teamID int64, opts *DiscussionListOptions) iter.Seq2[*TeamDiscussion, error] { + return func(yield func(*TeamDiscussion, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &DiscussionListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListDiscussionsByID(ctx, orgID, teamID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListDiscussionsBySlugIter returns an iterator that paginates through all results of ListDiscussionsBySlug. +func (s *TeamsService) ListDiscussionsBySlugIter(ctx context.Context, org string, slug string, opts *DiscussionListOptions) iter.Seq2[*TeamDiscussion, error] { + return func(yield func(*TeamDiscussion, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &DiscussionListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListDiscussionsBySlug(ctx, org, slug, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListExternalGroupsIter returns an iterator that paginates through all results of ListExternalGroups. +func (s *TeamsService) ListExternalGroupsIter(ctx context.Context, org string, opts *ListExternalGroupsOptions) iter.Seq2[*ExternalGroup, error] { + return func(yield func(*ExternalGroup, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListExternalGroupsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListExternalGroups(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*ExternalGroup + if results != nil { + iterItems = results.Groups + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListIDPGroupsInOrganizationIter returns an iterator that paginates through all results of ListIDPGroupsInOrganization. +func (s *TeamsService) ListIDPGroupsInOrganizationIter(ctx context.Context, org string, opts *ListIDPGroupsOptions) iter.Seq2[*IDPGroup, error] { + return func(yield func(*IDPGroup, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListIDPGroupsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListIDPGroupsInOrganization(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*IDPGroup + if results != nil { + iterItems = results.Groups + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.After == "" { + break + } + opts.ListCursorOptions.After = resp.After + } + } +} + +// ListPendingTeamInvitationsByIDIter returns an iterator that paginates through all results of ListPendingTeamInvitationsByID. +func (s *TeamsService) ListPendingTeamInvitationsByIDIter(ctx context.Context, orgID int64, teamID int64, opts *ListOptions) iter.Seq2[*Invitation, error] { + return func(yield func(*Invitation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPendingTeamInvitationsByID(ctx, orgID, teamID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListPendingTeamInvitationsBySlugIter returns an iterator that paginates through all results of ListPendingTeamInvitationsBySlug. +func (s *TeamsService) ListPendingTeamInvitationsBySlugIter(ctx context.Context, org string, slug string, opts *ListOptions) iter.Seq2[*Invitation, error] { + return func(yield func(*Invitation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPendingTeamInvitationsBySlug(ctx, org, slug, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListTeamMembersByIDIter returns an iterator that paginates through all results of ListTeamMembersByID. +func (s *TeamsService) ListTeamMembersByIDIter(ctx context.Context, orgID int64, teamID int64, opts *TeamListTeamMembersOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &TeamListTeamMembersOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamMembersByID(ctx, orgID, teamID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListTeamMembersBySlugIter returns an iterator that paginates through all results of ListTeamMembersBySlug. +func (s *TeamsService) ListTeamMembersBySlugIter(ctx context.Context, org string, slug string, opts *TeamListTeamMembersOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &TeamListTeamMembersOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamMembersBySlug(ctx, org, slug, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListTeamReposByIDIter returns an iterator that paginates through all results of ListTeamReposByID. +func (s *TeamsService) ListTeamReposByIDIter(ctx context.Context, orgID int64, teamID int64, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamReposByID(ctx, orgID, teamID, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListTeamReposBySlugIter returns an iterator that paginates through all results of ListTeamReposBySlug. +func (s *TeamsService) ListTeamReposBySlugIter(ctx context.Context, org string, slug string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeamReposBySlug(ctx, org, slug, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListTeamsIter returns an iterator that paginates through all results of ListTeams. +func (s *TeamsService) ListTeamsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Team, error] { + return func(yield func(*Team, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListTeams(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserTeamsIter returns an iterator that paginates through all results of ListUserTeams. +func (s *TeamsService) ListUserTeamsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Team, error] { + return func(yield func(*Team, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserTeams(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListAttestationsIter returns an iterator that paginates through all results of ListAttestations. +func (s *UsersService) ListAttestationsIter(ctx context.Context, user string, subjectDigest string, opts *ListOptions) iter.Seq2[*Attestation, error] { + return func(yield func(*Attestation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAttestations(ctx, user, subjectDigest, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Attestation + if results != nil { + iterItems = results.Attestations + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListBlockedUsersIter returns an iterator that paginates through all results of ListBlockedUsers. +func (s *UsersService) ListBlockedUsersIter(ctx context.Context, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListBlockedUsers(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListEmailsIter returns an iterator that paginates through all results of ListEmails. +func (s *UsersService) ListEmailsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*UserEmail, error] { + return func(yield func(*UserEmail, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListEmails(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListFollowersIter returns an iterator that paginates through all results of ListFollowers. +func (s *UsersService) ListFollowersIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListFollowers(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListFollowingIter returns an iterator that paginates through all results of ListFollowing. +func (s *UsersService) ListFollowingIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*User, error] { + return func(yield func(*User, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListFollowing(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListGPGKeysIter returns an iterator that paginates through all results of ListGPGKeys. +func (s *UsersService) ListGPGKeysIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*GPGKey, error] { + return func(yield func(*GPGKey, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListGPGKeys(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListInvitationsIter returns an iterator that paginates through all results of ListInvitations. +func (s *UsersService) ListInvitationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*RepositoryInvitation, error] { + return func(yield func(*RepositoryInvitation, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListInvitations(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListKeysIter returns an iterator that paginates through all results of ListKeys. +func (s *UsersService) ListKeysIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*Key, error] { + return func(yield func(*Key, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListKeys(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListPackageVersionsIter returns an iterator that paginates through all results of ListPackageVersions. +func (s *UsersService) ListPackageVersionsIter(ctx context.Context, packageType string, packageName string, opts *ListPackageVersionsOptions) iter.Seq2[*PackageVersion, error] { + return func(yield func(*PackageVersion, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListPackageVersionsOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPackageVersions(ctx, packageType, packageName, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListPackagesIter returns an iterator that paginates through all results of ListPackages. +func (s *UsersService) ListPackagesIter(ctx context.Context, user string, opts *PackageListOptions) iter.Seq2[*Package, error] { + return func(yield func(*Package, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &PackageListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListPackages(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.ListOptions.Page = resp.NextPage + } + } +} + +// ListSSHSigningKeysIter returns an iterator that paginates through all results of ListSSHSigningKeys. +func (s *UsersService) ListSSHSigningKeysIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*SSHSigningKey, error] { + return func(yield func(*SSHSigningKey, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListSSHSigningKeys(ctx, user, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListSocialAccountsIter returns an iterator that paginates through all results of ListSocialAccounts. +func (s *UsersService) ListSocialAccountsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*SocialAccount, error] { + return func(yield func(*SocialAccount, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListSocialAccounts(ctx, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListUserSocialAccountsIter returns an iterator that paginates through all results of ListUserSocialAccounts. +func (s *UsersService) ListUserSocialAccountsIter(ctx context.Context, username string, opts *ListOptions) iter.Seq2[*SocialAccount, error] { + return func(yield func(*SocialAccount, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListUserSocialAccounts(ctx, username, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} diff --git a/vendor/github.com/google/go-github/v82/github/github.go b/vendor/github.com/google/go-github/v85/github/github.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/github.go rename to vendor/github.com/google/go-github/v85/github/github.go index a806e7b80..9cb3a53fb 100644 --- a/vendor/github.com/google/go-github/v82/github/github.go +++ b/vendor/github.com/google/go-github/v85/github/github.go @@ -4,8 +4,9 @@ // license that can be found in the LICENSE file. //go:generate go run gen-accessors.go +//go:generate go run gen-iterators.go //go:generate go run gen-stringify-test.go -//go:generate ../script/metadata.sh update-go +//go:generate sh ../script/metadata.sh update-go package github @@ -18,8 +19,8 @@ import ( "io" "net/http" "net/url" - "reflect" "regexp" + "slices" "strconv" "strings" "sync" @@ -29,21 +30,23 @@ import ( ) const ( - Version = "v82.0.0" + Version = "v85.0.0" + + HeaderRateLimit = "X-Ratelimit-Limit" + HeaderRateRemaining = "X-Ratelimit-Remaining" + HeaderRateReset = "X-Ratelimit-Reset" + HeaderRateResource = "X-Ratelimit-Resource" + HeaderRateUsed = "X-Ratelimit-Used" + HeaderRequestID = "X-Github-Request-Id" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" defaultUserAgent = "go-github" + "/" + Version uploadBaseURL = "https://uploads.github.com/" - headerAPIVersion = "X-Github-Api-Version" - headerRateLimit = "X-Ratelimit-Limit" - headerRateRemaining = "X-Ratelimit-Remaining" - headerRateUsed = "X-Ratelimit-Used" - headerRateReset = "X-Ratelimit-Reset" - headerRateResource = "X-Ratelimit-Resource" - headerOTP = "X-Github-Otp" - headerRetryAfter = "Retry-After" + headerAPIVersion = "X-Github-Api-Version" + headerOTP = "X-Github-Otp" + headerRetryAfter = "Retry-After" headerTokenExpiration = "Github-Authentication-Token-Expiration" @@ -155,9 +158,13 @@ const ( var errNonNilContext = errors.New("context must be non-nil") +// ErrPathForbidden is returned when a URL path contains ".." as a path +// segment, which could allow path traversal attacks. +var ErrPathForbidden = errors.New("path must not contain '..' due to auth vulnerability issue") + // A Client manages communication with the GitHub API. type Client struct { - clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func. + clientMu sync.Mutex // clientMu protects the client fields during copy and Client calls. client *http.Client // HTTP client used to communicate with the API. clientIgnoreRedirects *http.Client // HTTP client used to communicate with the API on endpoints where we don't want to follow redirects. @@ -309,11 +316,12 @@ type RawOptions struct { Type RawType } +type structPtr[T any] interface{ *T } + // addOptions adds the parameters in opts as URL query parameters to s. opts // must be a struct whose fields may contain "url" tags. -func addOptions(s string, opts any) (string, error) { - v := reflect.ValueOf(opts) - if v.Kind() == reflect.Pointer && v.IsNil() { +func addOptions[P structPtr[T], T any](s string, opts P) (string, error) { + if opts == nil { return s, nil } @@ -409,7 +417,8 @@ func (c *Client) WithEnterpriseURLs(baseURL, uploadURL string) (*Client, error) } if !strings.HasSuffix(c2.UploadURL.Path, "/api/uploads/") && !strings.HasPrefix(c2.UploadURL.Host, "api.") && - !strings.Contains(c2.UploadURL.Host, ".api.") { + !strings.Contains(c2.UploadURL.Host, ".api.") && + !strings.HasPrefix(c2.UploadURL.Host, "uploads.") { c2.UploadURL.Path += "api/uploads/" } return c2, nil @@ -463,7 +472,11 @@ func (c *Client) initialize() { c.Issues = (*IssuesService)(&c.common) c.Licenses = (*LicensesService)(&c.common) c.Markdown = (*MarkdownService)(&c.common) - c.Marketplace = &MarketplaceService{client: c} + var marketplaceStubbed bool + if c.Marketplace != nil { + marketplaceStubbed = c.Marketplace.Stubbed + } + c.Marketplace = &MarketplaceService{client: c, Stubbed: marketplaceStubbed} c.Meta = (*MetaService)(&c.common) c.Migrations = (*MigrationService)(&c.common) c.Organizations = (*OrganizationsService)(&c.common) @@ -494,6 +507,9 @@ func (c *Client) copy() *Client { RateLimitRedirectionalEndpoints: c.RateLimitRedirectionalEndpoints, secondaryRateLimitReset: c.secondaryRateLimitReset, } + if c.Marketplace != nil { + clone.Marketplace = &MarketplaceService{Stubbed: c.Marketplace.Stubbed} + } c.clientMu.Unlock() if c.client != nil { clone.client.Transport = c.client.Transport @@ -502,7 +518,7 @@ func (c *Client) copy() *Client { clone.client.Timeout = c.client.Timeout } c.rateMu.Lock() - copy(clone.rateLimits[:], c.rateLimits[:]) + clone.rateLimits = c.rateLimits c.rateMu.Unlock() return &clone } @@ -550,6 +566,10 @@ func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOpti return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } + if err := checkURLPathTraversal(urlStr); err != nil { + return nil, err + } + u, err := c.BaseURL.Parse(urlStr) if err != nil { return nil, err @@ -596,6 +616,10 @@ func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOp return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } + if err := checkURLPathTraversal(urlStr); err != nil { + return nil, err + } + u, err := c.BaseURL.Parse(urlStr) if err != nil { return nil, err @@ -620,6 +644,25 @@ func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOp return req, nil } +// checkURLPathTraversal returns ErrPathForbidden if urlStr contains ".." as a +// path segment (e.g. "a/../b"), preventing path traversal attacks. It does not +// match ".." embedded within a segment (e.g. "file..txt"). The check is +// performed only on the path portion of the URL, ignoring any query string or +// fragment. +func checkURLPathTraversal(urlStr string) error { + if !strings.Contains(urlStr, "..") { + return nil + } + u, err := url.Parse(urlStr) + if err != nil { + return err + } + if slices.Contains(strings.Split(u.Path, "/"), "..") { + return ErrPathForbidden + } + return nil +} + // NewUploadRequest creates an upload request. A relative URL can be provided in // urlStr, in which case it is resolved relative to the UploadURL of the Client. // Relative URLs should always be specified without a preceding slash. @@ -627,12 +670,30 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m if !strings.HasSuffix(c.UploadURL.Path, "/") { return nil, fmt.Errorf("uploadURL must have a trailing slash, but %q does not", c.UploadURL) } + + if err := checkURLPathTraversal(urlStr); err != nil { + return nil, err + } + u, err := c.UploadURL.Parse(urlStr) if err != nil { return nil, err } - req, err := http.NewRequest("POST", u.String(), reader) + requestBody := reader + if reader != nil { + // Wrap the provided reader so transport code does not observe concrete body types + // (for example *os.File) and switch to platform-specific sendfile fast paths. + // + // Why this exists: + // race-enabled test runs on Windows have surfaced data races in the sendfile path + // while request read/write loops run concurrently. Hiding concrete type information + // keeps uploads on the generic io.Reader copy path, which is race-stable and preserves + // request semantics (same bytes, same headers, same content length). + requestBody = uploadRequestBodyReader{Reader: reader} + } + + req, err := http.NewRequest("POST", u.String(), requestBody) if err != nil { return nil, err } @@ -654,6 +715,12 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m return req, nil } +// uploadRequestBodyReader intentionally wraps an io.Reader to hide concrete reader types. +// See NewUploadRequest for why this prevents race-prone transport optimizations. +type uploadRequestBodyReader struct { + io.Reader +} + // Response is a GitHub API response. This wraps the standard http.Response // returned from GitHub and provides convenient access to things like // pagination links. @@ -740,8 +807,7 @@ func (r *Response) populatePageValues() { if cursor := q.Get("cursor"); cursor != "" { for _, segment := range segments[1:] { - switch strings.TrimSpace(segment) { - case `rel="next"`: + if strings.TrimSpace(segment) == `rel="next"` { r.Cursor = cursor } } @@ -785,21 +851,21 @@ func (r *Response) populatePageValues() { // parseRate parses the rate related headers. func parseRate(r *http.Response) Rate { var rate Rate - if limit := r.Header.Get(headerRateLimit); limit != "" { + if limit := r.Header.Get(HeaderRateLimit); limit != "" { rate.Limit, _ = strconv.Atoi(limit) } - if remaining := r.Header.Get(headerRateRemaining); remaining != "" { + if remaining := r.Header.Get(HeaderRateRemaining); remaining != "" { rate.Remaining, _ = strconv.Atoi(remaining) } - if used := r.Header.Get(headerRateUsed); used != "" { + if used := r.Header.Get(HeaderRateUsed); used != "" { rate.Used, _ = strconv.Atoi(used) } - if reset := r.Header.Get(headerRateReset); reset != "" { + if reset := r.Header.Get(HeaderRateReset); reset != "" { if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 { rate.Reset = Timestamp{time.Unix(v, 0)} } } - if resource := r.Header.Get(headerRateResource); resource != "" { + if resource := r.Header.Get(HeaderRateResource); resource != "" { rate.Resource = resource } return rate @@ -820,7 +886,7 @@ func parseSecondaryRate(r *http.Response) *time.Duration { // According to GitHub support, endpoints might return x-ratelimit-reset instead, // as an integer which represents the number of seconds since epoch UTC, // representing the time to resume making requests. - if v := r.Header.Get(headerRateReset); v != "" { + if v := r.Header.Get(HeaderRateReset); v != "" { secondsSinceEpoch, _ := strconv.ParseInt(v, 10, 64) // Error handling is noop. retryAfter := time.Until(time.Unix(secondsSinceEpoch, 0)) return &retryAfter @@ -1024,6 +1090,12 @@ func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRed return nil, nil, errInvalidLocation } newURL := c.BaseURL.ResolveReference(rerr.Location) + // Refuse to follow a permanent redirect to a different host: + // req.Clone preserves Authorization headers added by the auth + // transport, so a cross-host target would leak credentials. + if newURL.Host != c.BaseURL.Host { + return nil, response, fmt.Errorf("refusing to follow cross-host redirect from %q to %q", c.BaseURL.Host, newURL.Host) + } newRequest := req.Clone(ctx) newRequest.URL = newURL return c.bareDoUntilFound(ctx, newRequest, maxRedirects-1) @@ -1158,7 +1230,7 @@ func compareHTTPResponse(r1, r2 *http.Response) bool { /* An ErrorResponse reports one or more errors caused by an API request. -GitHub API docs: https://docs.github.com/rest/#client-errors +GitHub API docs: https://docs.github.com/rest?apiVersion=2022-11-28#client-errors */ type ErrorResponse struct { Response *http.Response `json:"-"` // HTTP response that caused this error @@ -1169,7 +1241,7 @@ type ErrorResponse struct { Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing // to some content that might help you resolve the error, see - // https://docs.github.com/rest/#client-errors + // https://docs.github.com/rest?apiVersion=2022-11-28#client-errors DocumentationURL string `json:"documentation_url,omitempty"` } @@ -1297,7 +1369,7 @@ func (ae *AcceptedError) Is(target error) bool { } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the -// "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -1360,15 +1432,23 @@ func (r *RedirectionError) Is(target error) bool { r.Location != nil && v.Location != nil && r.Location.String() == v.Location.String()) // or they are both not nil and marshaled identically } -// sanitizeURL redacts the client_secret parameter from the URL which may be +var sensitiveParams = []string{"client_secret", "access_token", "token"} + +// sanitizeURL redacts sensitive parameters from the URL which may be // exposed to the user. func sanitizeURL(uri *url.URL) *url.URL { if uri == nil { return nil } params := uri.Query() - if len(params.Get("client_secret")) > 0 { - params.Set("client_secret", "REDACTED") + var redacted bool + for _, p := range sensitiveParams { + if len(params.Get(p)) > 0 { + params.Set(p, "REDACTED") + redacted = true + } + } + if redacted { uri.RawQuery = params.Encode() } return uri @@ -1394,7 +1474,7 @@ GitHub error responses structure are often undocumented and inconsistent. Sometimes error is just a simple string (Issue #540). In such cases, Message represents an error message as a workaround. -GitHub API docs: https://docs.github.com/rest/#client-errors +GitHub API docs: https://docs.github.com/rest?apiVersion=2022-11-28#client-errors */ type Error struct { Resource string `json:"resource"` // resource on which the error occurred @@ -1451,13 +1531,18 @@ func CheckResponse(r *http.Response) error { switch { case r.StatusCode == http.StatusUnauthorized && strings.HasPrefix(r.Header.Get(headerOTP), "required"): return (*TwoFactorAuthError)(errorResponse) - case r.StatusCode == http.StatusForbidden && r.Header.Get(headerRateRemaining) == "0": + // Primary rate limit exceeded: GitHub returns 403 or 429 with X-RateLimit-Remaining: 0 + // See: https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28 + case (r.StatusCode == http.StatusForbidden || r.StatusCode == http.StatusTooManyRequests) && + r.Header.Get(HeaderRateRemaining) == "0": return &RateLimitError{ Rate: parseRate(r), Response: errorResponse.Response, Message: errorResponse.Message, } - case r.StatusCode == http.StatusForbidden && + // Secondary rate limit exceeded: GitHub returns 403 or 429 with specific documentation_url + // See: https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits + case (r.StatusCode == http.StatusForbidden || r.StatusCode == http.StatusTooManyRequests) && (strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits") || strings.HasSuffix(errorResponse.DocumentationURL, "secondary-rate-limits")): abuseRateLimitError := &AbuseRateLimitError{ @@ -1535,13 +1620,13 @@ const ( // GetRateLimitCategory returns the rate limit RateLimitCategory of the endpoint, determined by HTTP method and Request.URL.Path. func GetRateLimitCategory(method, path string) RateLimitCategory { switch { - // https://docs.github.com/rest/rate-limit#about-rate-limits + // https://docs.github.com/rest/rate-limit?apiVersion=2022-11-28#about-rate-limits default: // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, // because no API found for this category. return CoreCategory - // https://docs.github.com/en/rest/search/search#search-code + // https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-code case strings.HasPrefix(path, "/search/code") && method == "GET": return CodeSearchCategory @@ -1555,31 +1640,31 @@ func GetRateLimitCategory(method, path string) RateLimitCategory { method == "POST": return IntegrationManifestCategory - // https://docs.github.com/rest/migrations/source-imports#start-an-import + // https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#start-an-import case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/import") && method == "PUT": return SourceImportCategory - // https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data + // https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28#upload-an-analysis-as-sarif-data case strings.HasSuffix(path, "/code-scanning/sarifs"): return CodeScanningUploadCategory - // https://docs.github.com/enterprise-cloud@latest/rest/scim + // https://docs.github.com/enterprise-cloud@latest/rest/scim?apiVersion=2022-11-28 case strings.HasPrefix(path, "/scim/"): return ScimCategory - // https://docs.github.com/en/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository + // https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/dependency-graph/snapshots") && method == "POST": return DependencySnapshotsCategory - // https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization + // https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization case strings.HasSuffix(path, "/audit-log"): return AuditLogCategory - // https://docs.github.com/en/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository + // https://docs.github.com/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/dependency-graph/sbom"): return DependencySBOMCategory @@ -1600,15 +1685,14 @@ func setCredentialsAsHeaders(req *http.Request, id, secret string) *http.Request // // Since we are going to modify only req.Header here, we only need a deep copy // of req.Header. - convertedRequest := new(http.Request) - *convertedRequest = *req + convertedRequest := *req convertedRequest.Header = make(http.Header, len(req.Header)) for k, s := range req.Header { convertedRequest.Header[k] = append([]string(nil), s...) } convertedRequest.SetBasicAuth(id, secret) - return convertedRequest + return &convertedRequest } /* @@ -1624,7 +1708,7 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps +See https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-oauth-apps for more information. */ type UnauthenticatedRateLimitedTransport struct { @@ -1768,11 +1852,35 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri if maxRedirects > 0 && resp.StatusCode == http.StatusMovedPermanently { _ = resp.Body.Close() u = resp.Header.Get("Location") + if err := c.checkRedirectHost(u); err != nil { + return nil, err + } resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects-1, opts...) } return resp, err } +// checkRedirectHost returns an error if the redirect target is on a different +// host than the client's configured BaseURL. This prevents credentials attached +// by the auth transport from being sent to an attacker-controlled host when a +// compromised or malicious API response returns a cross-origin Location header. +// An empty Location is also rejected. +func (c *Client) checkRedirectHost(location string) error { + if location == "" { + return errInvalidLocation + } + target, err := url.Parse(location) + if err != nil { + return fmt.Errorf("invalid redirect location %q: %w", location, err) + } + // Resolve relative locations against BaseURL so relative paths are allowed. + target = c.BaseURL.ResolveReference(target) + if target.Host != c.BaseURL.Host { + return fmt.Errorf("refusing to follow cross-host redirect from %q to %q", c.BaseURL.Host, target.Host) + } + return nil +} + // Ptr is a helper routine that allocates a new T value // to store v and returns a pointer to it. func Ptr[T any](v T) *T { @@ -1783,25 +1891,33 @@ func Ptr[T any](v T) *T { // to store v and returns a pointer to it. // // Deprecated: use Ptr instead. -func Bool(v bool) *bool { return &v } +// +//go:fix inline +func Bool(v bool) *bool { return Ptr(v) } // Int is a helper routine that allocates a new int value // to store v and returns a pointer to it. // // Deprecated: use Ptr instead. -func Int(v int) *int { return &v } +// +//go:fix inline +func Int(v int) *int { return Ptr(v) } // Int64 is a helper routine that allocates a new int64 value // to store v and returns a pointer to it. // // Deprecated: use Ptr instead. -func Int64(v int64) *int64 { return &v } +// +//go:fix inline +func Int64(v int64) *int64 { return Ptr(v) } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. // // Deprecated: use Ptr instead. -func String(v string) *string { return &v } +// +//go:fix inline +func String(v string) *string { return Ptr(v) } // roundTripperFunc creates a RoundTripper (transport). type roundTripperFunc func(*http.Request) (*http.Response, error) @@ -1824,3 +1940,8 @@ func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) { } return runID, nil } + +// withContext returns a shallow copy of req with its context changed to ctx. +func withContext(ctx context.Context, req *http.Request) *http.Request { + return req.WithContext(ctx) +} diff --git a/vendor/github.com/google/go-github/v82/github/gitignore.go b/vendor/github.com/google/go-github/v85/github/gitignore.go similarity index 85% rename from vendor/github.com/google/go-github/v82/github/gitignore.go rename to vendor/github.com/google/go-github/v85/github/gitignore.go index 34cf285e1..0ddf45e80 100644 --- a/vendor/github.com/google/go-github/v82/github/gitignore.go +++ b/vendor/github.com/google/go-github/v85/github/gitignore.go @@ -13,7 +13,7 @@ import ( // GitignoresService provides access to the gitignore related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/gitignore/ +// GitHub API docs: https://docs.github.com/rest/gitignore?apiVersion=2022-11-28 type GitignoresService service // Gitignore represents a .gitignore file as returned by the GitHub API. @@ -28,7 +28,7 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // -// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore?apiVersion=2022-11-28#get-all-gitignore-templates // //meta:operation GET /gitignore/templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { @@ -48,7 +48,7 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // -// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore?apiVersion=2022-11-28#get-a-gitignore-template // //meta:operation GET /gitignore/templates/{name} func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { @@ -58,8 +58,8 @@ func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, * return nil, nil, err } - gitignore := new(Gitignore) - resp, err := s.client.Do(ctx, req, gitignore) + var gitignore *Gitignore + resp, err := s.client.Do(ctx, req, &gitignore) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/interactions.go b/vendor/github.com/google/go-github/v85/github/interactions.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/interactions.go rename to vendor/github.com/google/go-github/v85/github/interactions.go index 2268273dd..92bd24b4d 100644 --- a/vendor/github.com/google/go-github/v82/github/interactions.go +++ b/vendor/github.com/google/go-github/v85/github/interactions.go @@ -8,7 +8,7 @@ package github // InteractionsService handles communication with the repository and organization related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/interactions/ +// GitHub API docs: https://docs.github.com/rest/interactions?apiVersion=2022-11-28 type InteractionsService service // InteractionRestriction represents the interaction restrictions for repository and organization. diff --git a/vendor/github.com/google/go-github/v82/github/interactions_orgs.go b/vendor/github.com/google/go-github/v85/github/interactions_orgs.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v85/github/interactions_orgs.go index 55f254817..73b52b08e 100644 --- a/vendor/github.com/google/go-github/v82/github/interactions_orgs.go +++ b/vendor/github.com/google/go-github/v85/github/interactions_orgs.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForOrg fetches the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs?apiVersion=2022-11-28#get-interaction-restrictions-for-an-organization // //meta:operation GET /orgs/{org}/interaction-limits func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { @@ -24,9 +24,8 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - organizationInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, organizationInteractions) + var organizationInteractions *InteractionRestriction + resp, err := s.client.Do(ctx, req, &organizationInteractions) if err != nil { return nil, resp, err } @@ -40,13 +39,13 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz // in public repositories for the given organization. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs?apiVersion=2022-11-28#set-interaction-restrictions-for-an-organization // //meta:operation PUT /orgs/{org}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) - interaction := &InteractionRestriction{Limit: Ptr(limit)} + interaction := &InteractionRestriction{Limit: &limit} req, err := s.client.NewRequest("PUT", u, interaction) if err != nil { @@ -55,9 +54,8 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - organizationInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, organizationInteractions) + var organizationInteractions *InteractionRestriction + resp, err := s.client.Do(ctx, req, &organizationInteractions) if err != nil { return nil, resp, err } @@ -67,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga // RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs?apiVersion=2022-11-28#remove-interaction-restrictions-for-an-organization // //meta:operation DELETE /orgs/{org}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/interactions_repos.go b/vendor/github.com/google/go-github/v85/github/interactions_repos.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/interactions_repos.go rename to vendor/github.com/google/go-github/v85/github/interactions_repos.go index d99de494a..8a0c23111 100644 --- a/vendor/github.com/google/go-github/v82/github/interactions_repos.go +++ b/vendor/github.com/google/go-github/v85/github/interactions_repos.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForRepo fetches the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos?apiVersion=2022-11-28#get-interaction-restrictions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { @@ -24,9 +24,8 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - repositoryInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, repositoryInteractions) + var repositoryInteractions *InteractionRestriction + resp, err := s.client.Do(ctx, req, &repositoryInteractions) if err != nil { return nil, resp, err } @@ -40,13 +39,13 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, // for the given repository. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos?apiVersion=2022-11-28#set-interaction-restrictions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) - interaction := &InteractionRestriction{Limit: Ptr(limit)} + interaction := &InteractionRestriction{Limit: &limit} req, err := s.client.NewRequest("PUT", u, interaction) if err != nil { @@ -55,9 +54,8 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - repositoryInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, repositoryInteractions) + var repositoryInteractions *InteractionRestriction + resp, err := s.client.Do(ctx, req, &repositoryInteractions) if err != nil { return nil, resp, err } @@ -67,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own // RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos?apiVersion=2022-11-28#remove-interaction-restrictions-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/issue_import.go b/vendor/github.com/google/go-github/v85/github/issue_import.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/issue_import.go rename to vendor/github.com/google/go-github/v85/github/issue_import.go index ea42db1ba..0feaac890 100644 --- a/vendor/github.com/google/go-github/v82/github/issue_import.go +++ b/vendor/github.com/google/go-github/v85/github/issue_import.go @@ -83,20 +83,20 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss req.Header.Set("Accept", mediaTypeIssueImportAPI) - i := new(IssueImportResponse) - resp, err := s.client.Do(ctx, req, i) + var i IssueImportResponse + resp, err := s.client.Do(ctx, req, &i) if err != nil { var aerr *AcceptedError if errors.As(err, &aerr) { - if err := json.Unmarshal(aerr.Raw, i); err != nil { - return i, resp, err + if err := json.Unmarshal(aerr.Raw, &i); err != nil { + return &i, resp, err } - return i, resp, err + return &i, resp, err } return nil, resp, err } - return i, resp, nil + return &i, resp, nil } // CheckStatus checks the status of an imported issue. @@ -113,8 +113,8 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string req.Header.Set("Accept", mediaTypeIssueImportAPI) - i := new(IssueImportResponse) - resp, err := s.client.Do(ctx, req, i) + var i *IssueImportResponse + resp, err := s.client.Do(ctx, req, &i) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/issues.go b/vendor/github.com/google/go-github/v85/github/issues.go similarity index 69% rename from vendor/github.com/google/go-github/v82/github/issues.go rename to vendor/github.com/google/go-github/v85/github/issues.go index 861c3fa5f..55c6c3472 100644 --- a/vendor/github.com/google/go-github/v82/github/issues.go +++ b/vendor/github.com/google/go-github/v85/github/issues.go @@ -14,7 +14,7 @@ import ( // IssuesService handles communication with the issue related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/issues/ +// GitHub API docs: https://docs.github.com/rest/issues?apiVersion=2022-11-28 type IssuesService service // Issue represents a GitHub issue on a repository. @@ -38,7 +38,7 @@ type Issue struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Issues REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/issues/issues#get-an-issue + // See: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue AuthorAssociation *string `json:"author_association,omitempty"` User *User `json:"user,omitempty"` Labels []*Label `json:"labels,omitempty"` @@ -100,11 +100,33 @@ type IssueRequest struct { Type *string `json:"type,omitempty"` } -// IssueListOptions specifies the optional parameters to the IssuesService.List -// and IssuesService.ListByOrg methods. -type IssueListOptions struct { +// PullRequestLinks object is added to the Issue object when it's an issue included +// in the IssueCommentEvent webhook payload, if the webhook is fired by a comment on a PR. +type PullRequestLinks struct { + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + DiffURL *string `json:"diff_url,omitempty"` + PatchURL *string `json:"patch_url,omitempty"` + MergedAt *Timestamp `json:"merged_at,omitempty"` +} + +// IssueType represents the type of issue. +// For now it shows up when receiving an Issue event. +type IssueType struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Color *string `json:"color,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// ListAllIssuesOptions specifies the optional parameters to the +// IssuesService.ListAllIssues method. +type ListAllIssuesOptions struct { // Filter specifies which issues to list. Possible values are: assigned, - // created, mentioned, subscribed, all. Default is "assigned". + // created, mentioned, subscribed, repos, all. Default is "assigned". Filter string `url:"filter,omitempty"` // State filters issues based on their state. Possible values are: open, @@ -125,68 +147,139 @@ type IssueListOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` - ListCursorOptions + Collab bool `url:"collab,omitempty"` + Orgs bool `url:"orgs,omitempty"` + Owned bool `url:"owned,omitempty"` + Pulls bool `url:"pulls,omitempty"` - // Add ListOptions so offset pagination with integer type "page" query parameter is accepted - // since ListCursorOptions accepts "page" as string only. ListOptions } -// PullRequestLinks object is added to the Issue object when it's an issue included -// in the IssueCommentEvent webhook payload, if the webhook is fired by a comment on a PR. -type PullRequestLinks struct { - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - DiffURL *string `json:"diff_url,omitempty"` - PatchURL *string `json:"patch_url,omitempty"` - MergedAt *Timestamp `json:"merged_at,omitempty"` +// ListAllIssues gets issues assigned to the authenticated user across all visible repositories including owned repositories, +// member repositories, and organization repositories. +// You can use the filter query parameter to fetch issues that are not necessarily assigned to you. +// +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-issues-assigned-to-the-authenticated-user +// +//meta:operation GET /issues +func (s *IssuesService) ListAllIssues(ctx context.Context, opts *ListAllIssuesOptions) ([]*Issue, *Response, error) { + u := "issues" + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var issues []*Issue + resp, err := s.client.Do(ctx, req, &issues) + if err != nil { + return nil, resp, err + } + + return issues, resp, nil } -// IssueType represents the type of issue. -// For now it shows up when receiving an Issue event. -type IssueType struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Color *string `json:"color,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` +// ListUserIssuesOptions specifies the optional parameters to the +// IssuesService.ListUserIssues method. +type ListUserIssuesOptions struct { + // Filter specifies which issues to list. Possible values are: assigned, + // created, mentioned, subscribed, repos, all. Default is "assigned". + Filter string `url:"filter,omitempty"` + + // State filters issues based on their state. Possible values are: open, + // closed, all. Default is "open". + State string `url:"state,omitempty"` + + // Labels filters issues based on their label. + Labels []string `url:"labels,comma,omitempty"` + + // Sort specifies how to sort issues. Possible values are: created, updated, + // and comments. Default value is "created". + Sort string `url:"sort,omitempty"` + + // Direction in which to sort issues. Possible values are: asc, desc. + // Default is "desc". + Direction string `url:"direction,omitempty"` + + // Since filters issues by time. + Since time.Time `url:"since,omitempty"` + + ListOptions } -// List the issues for the authenticated user. If all is true, list issues -// across all the user's visible repositories including owned, member, and -// organization repositories; if false, list only owned and member -// repositories. -// -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// ListUserIssues gets issues across owned and member repositories assigned to the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-user-account-issues-assigned-to-the-authenticated-user // -//meta:operation GET /issues //meta:operation GET /user/issues -func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptions) ([]*Issue, *Response, error) { - var u string - if all { - u = "issues" - } else { - u = "user/issues" +func (s *IssuesService) ListUserIssues(ctx context.Context, opts *ListUserIssuesOptions) ([]*Issue, *Response, error) { + u := "user/issues" + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err } - return s.listIssues(ctx, u, opts) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var issues []*Issue + resp, err := s.client.Do(ctx, req, &issues) + if err != nil { + return nil, resp, err + } + + return issues, resp, nil +} + +// IssueListByOrgOptions specifies the optional parameters to the +// IssuesService.ListByOrg method. +type IssueListByOrgOptions struct { + // Filter specifies which issues to list. Possible values are: assigned, + // created, mentioned, subscribed, repos, all. Default is "assigned". + Filter string `url:"filter,omitempty"` + + // State filters issues based on their state. Possible values are: open, + // closed, all. Default is "open". + State string `url:"state,omitempty"` + + // Labels filters issues based on their label. + Labels []string `url:"labels,comma,omitempty"` + + // Type can be the name of an issue type. + Type string `url:"type,omitempty"` + + // Sort specifies how to sort issues. Possible values are: created, updated, + // and comments. Default value is "created". + Sort string `url:"sort,omitempty"` + + // Direction in which to sort issues. Possible values are: asc, desc. + // Default is "desc". + Direction string `url:"direction,omitempty"` + + // Since filters issues by time. + Since time.Time `url:"since,omitempty"` + + ListOptions } // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-organization-issues-assigned-to-the-authenticated-user // //meta:operation GET /orgs/{org}/issues -func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListOptions) ([]*Issue, *Response, error) { +func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListByOrgOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) - return s.listIssues(ctx, u, opts) -} - -func (s *IssuesService) listIssues(ctx context.Context, u string, opts *IssueListOptions) ([]*Issue, *Response, error) { u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -225,6 +318,11 @@ type IssueListByRepoOptions struct { // any assigned user. Assignee string `url:"assignee,omitempty"` + // Type can be the name of an issue type. + // If the string * is passed, issues with any type are accepted. + // If the string none is passed, issues without type are returned. + Type string `url:"type,omitempty"` + // Creator filters issues based on their creator. Creator string `url:"creator,omitempty"` @@ -245,6 +343,7 @@ type IssueListByRepoOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` + // ListCursorOptions specifies the optional parameters for cursor pagination. ListCursorOptions // Add ListOptions so offset pagination with integer type "page" query parameter is accepted @@ -254,7 +353,7 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues // //meta:operation GET /repos/{owner}/{repo}/issues func (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { @@ -282,7 +381,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts // Get a single issue. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Get(ctx context.Context, owner, repo string, number int) (*Issue, *Response, error) { @@ -294,8 +393,8 @@ func (s *IssuesService) Get(ctx context.Context, owner, repo string, number int) req.Header.Set("Accept", mediaTypeReactionsPreview) - issue := new(Issue) - resp, err := s.client.Do(ctx, req, issue) + var issue *Issue + resp, err := s.client.Do(ctx, req, &issue) if err != nil { return nil, resp, err } @@ -305,7 +404,7 @@ func (s *IssuesService) Get(ctx context.Context, owner, repo string, number int) // Create a new issue on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#create-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues func (s *IssuesService) Create(ctx context.Context, owner, repo string, issue *IssueRequest) (*Issue, *Response, error) { @@ -315,8 +414,8 @@ func (s *IssuesService) Create(ctx context.Context, owner, repo string, issue *I return nil, nil, err } - i := new(Issue) - resp, err := s.client.Do(ctx, req, i) + var i *Issue + resp, err := s.client.Do(ctx, req, &i) if err != nil { return nil, resp, err } @@ -326,7 +425,7 @@ func (s *IssuesService) Create(ctx context.Context, owner, repo string, issue *I // Edit (update) an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#update-an-issue // //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Edit(ctx context.Context, owner, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { @@ -336,8 +435,8 @@ func (s *IssuesService) Edit(ctx context.Context, owner, repo string, number int return nil, nil, err } - i := new(Issue) - resp, err := s.client.Do(ctx, req, i) + var i *Issue + resp, err := s.client.Do(ctx, req, &i) if err != nil { return nil, resp, err } @@ -349,7 +448,7 @@ func (s *IssuesService) Edit(ctx context.Context, owner, repo string, number int // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#update-an-issue // //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { @@ -361,8 +460,8 @@ func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, return nil, nil, err } - i := new(Issue) - resp, err := s.client.Do(ctx, req, i) + var i *Issue + resp, err := s.client.Do(ctx, req, &i) if err != nil { return nil, resp, err } @@ -381,7 +480,7 @@ type LockIssueOptions struct { // Lock an issue's conversation. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#lock-an-issue // //meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Lock(ctx context.Context, owner, repo string, number int, opts *LockIssueOptions) (*Response, error) { @@ -396,7 +495,7 @@ func (s *IssuesService) Lock(ctx context.Context, owner, repo string, number int // Unlock an issue's conversation. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#unlock-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Unlock(ctx context.Context, owner, repo string, number int) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/issues_assignees.go b/vendor/github.com/google/go-github/v85/github/issues_assignees.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/issues_assignees.go rename to vendor/github.com/google/go-github/v85/github/issues_assignees.go index fd065771e..d198d2c84 100644 --- a/vendor/github.com/google/go-github/v82/github/issues_assignees.go +++ b/vendor/github.com/google/go-github/v85/github/issues_assignees.go @@ -13,7 +13,7 @@ import ( // ListAssignees fetches all available assignees (owners and collaborators) to // which issues may be assigned. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#list-assignees // //meta:operation GET /repos/{owner}/{repo}/assignees func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { @@ -39,7 +39,7 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o // IsAssignee checks if a user is an assignee for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#check-if-a-user-can-be-assigned // //meta:operation GET /repos/{owner}/{repo}/assignees/{assignee} func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) { @@ -56,7 +56,7 @@ func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string // AddAssignees adds the provided GitHub users as assignees to the issue. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#add-assignees-to-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { @@ -69,8 +69,8 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu return nil, nil, err } - issue := &Issue{} - resp, err := s.client.Do(ctx, req, issue) + var issue *Issue + resp, err := s.client.Do(ctx, req, &issue) if err != nil { return nil, resp, err } @@ -80,7 +80,7 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu // RemoveAssignees removes the provided GitHub users as assignees from the issue. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#remove-assignees-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { @@ -93,8 +93,8 @@ func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, return nil, nil, err } - issue := &Issue{} - resp, err := s.client.Do(ctx, req, issue) + var issue *Issue + resp, err := s.client.Do(ctx, req, &issue) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/issues_comments.go b/vendor/github.com/google/go-github/v85/github/issues_comments.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/issues_comments.go rename to vendor/github.com/google/go-github/v85/github/issues_comments.go index ef5314b18..3f610e39c 100644 --- a/vendor/github.com/google/go-github/v82/github/issues_comments.go +++ b/vendor/github.com/google/go-github/v85/github/issues_comments.go @@ -25,7 +25,7 @@ type IssueComment struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Issue Comments REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/issues/comments#get-an-issue-comment + // See: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#get-an-issue-comment AuthorAssociation *string `json:"author_association,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` @@ -54,9 +54,9 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#list-issue-comments // -// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#list-issue-comments-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/issues/comments //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/comments @@ -90,7 +90,7 @@ func (s *IssuesService) ListComments(ctx context.Context, owner, repo string, nu // GetComment fetches the specified issue comment. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#get-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*IssueComment, *Response, error) { @@ -103,8 +103,8 @@ func (s *IssuesService) GetComment(ctx context.Context, owner, repo string, comm req.Header.Set("Accept", mediaTypeReactionsPreview) - comment := new(IssueComment) - resp, err := s.client.Do(ctx, req, comment) + var comment *IssueComment + resp, err := s.client.Do(ctx, req, &comment) if err != nil { return nil, resp, err } @@ -114,7 +114,7 @@ func (s *IssuesService) GetComment(ctx context.Context, owner, repo string, comm // CreateComment creates a new comment on the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/comments func (s *IssuesService) CreateComment(ctx context.Context, owner, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { @@ -123,8 +123,8 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner, repo string, n if err != nil { return nil, nil, err } - c := new(IssueComment) - resp, err := s.client.Do(ctx, req, c) + var c *IssueComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -135,7 +135,7 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner, repo string, n // EditComment updates an issue comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#update-an-issue-comment // //meta:operation PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { @@ -144,8 +144,8 @@ func (s *IssuesService) EditComment(ctx context.Context, owner, repo string, com if err != nil { return nil, nil, err } - c := new(IssueComment) - resp, err := s.client.Do(ctx, req, c) + var c *IssueComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -155,7 +155,7 @@ func (s *IssuesService) EditComment(ctx context.Context, owner, repo string, com // DeleteComment deletes an issue comment. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#delete-an-issue-comment // //meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/issues_events.go b/vendor/github.com/google/go-github/v85/github/issues_events.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/issues_events.go rename to vendor/github.com/google/go-github/v85/github/issues_events.go index 8e234d7e0..4e0be6a24 100644 --- a/vendor/github.com/google/go-github/v82/github/issues_events.go +++ b/vendor/github.com/google/go-github/v85/github/issues_events.go @@ -104,7 +104,7 @@ type DismissedReview struct { // ListIssueEvents lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#list-issue-events // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/events func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) { @@ -132,7 +132,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, // ListRepositoryEvents lists events for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#list-issue-events-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/issues/events func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { @@ -158,7 +158,7 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st // GetEvent returns the specified issue event. // -// GitHub API docs: https://docs.github.com/rest/issues/events#get-an-issue-event +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#get-an-issue-event // //meta:operation GET /repos/{owner}/{repo}/issues/events/{event_id} func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) { @@ -169,8 +169,8 @@ func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int return nil, nil, err } - event := new(IssueEvent) - resp, err := s.client.Do(ctx, req, event) + var event *IssueEvent + resp, err := s.client.Do(ctx, req, &event) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/issues_labels.go b/vendor/github.com/google/go-github/v85/github/issues_labels.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/issues_labels.go rename to vendor/github.com/google/go-github/v85/github/issues_labels.go index 243670ec7..87f13ab18 100644 --- a/vendor/github.com/google/go-github/v82/github/issues_labels.go +++ b/vendor/github.com/google/go-github/v85/github/issues_labels.go @@ -27,7 +27,7 @@ func (l Label) String() string { // ListLabels lists all labels for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#list-labels-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/labels func (s *IssuesService) ListLabels(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Label, *Response, error) { @@ -53,7 +53,7 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner, repo string, opts // GetLabel gets a single label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#get-a-label // //meta:operation GET /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) GetLabel(ctx context.Context, owner, repo, name string) (*Label, *Response, error) { @@ -63,8 +63,8 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner, repo, name string) return nil, nil, err } - label := new(Label) - resp, err := s.client.Do(ctx, req, label) + var label *Label + resp, err := s.client.Do(ctx, req, &label) if err != nil { return nil, resp, err } @@ -74,7 +74,7 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner, repo, name string) // CreateLabel creates a new label on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#create-a-label // //meta:operation POST /repos/{owner}/{repo}/labels func (s *IssuesService) CreateLabel(ctx context.Context, owner, repo string, label *Label) (*Label, *Response, error) { @@ -84,8 +84,8 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner, repo string, lab return nil, nil, err } - l := new(Label) - resp, err := s.client.Do(ctx, req, l) + var l *Label + resp, err := s.client.Do(ctx, req, &l) if err != nil { return nil, resp, err } @@ -95,7 +95,7 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner, repo string, lab // EditLabel edits a label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#update-a-label // //meta:operation PATCH /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) EditLabel(ctx context.Context, owner, repo, name string, label *Label) (*Label, *Response, error) { @@ -105,8 +105,8 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner, repo, name string, return nil, nil, err } - l := new(Label) - resp, err := s.client.Do(ctx, req, l) + var l *Label + resp, err := s.client.Do(ctx, req, &l) if err != nil { return nil, resp, err } @@ -116,7 +116,7 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner, repo, name string, // DeleteLabel deletes a label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#delete-a-label // //meta:operation DELETE /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) DeleteLabel(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -130,7 +130,7 @@ func (s *IssuesService) DeleteLabel(ctx context.Context, owner, repo, name strin // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#list-labels-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { @@ -156,7 +156,7 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner, repo strin // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) { @@ -177,7 +177,7 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string // RemoveLabelForIssue removes a label for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#remove-a-label-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner, repo string, number int, label string) (*Response, error) { @@ -192,7 +192,7 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner, repo str // ReplaceLabelsForIssue replaces all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#set-labels-for-an-issue // //meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) { @@ -213,7 +213,7 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner, repo s // RemoveLabelsForIssue removes all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#remove-all-labels-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner, repo string, number int) (*Response, error) { @@ -228,7 +228,7 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner, repo st // ListLabelsForMilestone lists labels for every issue in a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#list-labels-for-issues-in-a-milestone // //meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/issues_milestones.go b/vendor/github.com/google/go-github/v85/github/issues_milestones.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/issues_milestones.go rename to vendor/github.com/google/go-github/v85/github/issues_milestones.go index 747829029..e1dfa9e44 100644 --- a/vendor/github.com/google/go-github/v82/github/issues_milestones.go +++ b/vendor/github.com/google/go-github/v85/github/issues_milestones.go @@ -54,7 +54,7 @@ type MilestoneListOptions struct { // ListMilestones lists all milestones for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#list-milestones // //meta:operation GET /repos/{owner}/{repo}/milestones func (s *IssuesService) ListMilestones(ctx context.Context, owner, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { @@ -80,7 +80,7 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner, repo string, // GetMilestone gets a single milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#get-a-milestone // //meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) GetMilestone(ctx context.Context, owner, repo string, number int) (*Milestone, *Response, error) { @@ -90,8 +90,8 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner, repo string, nu return nil, nil, err } - milestone := new(Milestone) - resp, err := s.client.Do(ctx, req, milestone) + var milestone *Milestone + resp, err := s.client.Do(ctx, req, &milestone) if err != nil { return nil, resp, err } @@ -101,7 +101,7 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner, repo string, nu // CreateMilestone creates a new milestone on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#create-a-milestone // //meta:operation POST /repos/{owner}/{repo}/milestones func (s *IssuesService) CreateMilestone(ctx context.Context, owner, repo string, milestone *Milestone) (*Milestone, *Response, error) { @@ -111,8 +111,8 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner, repo string, return nil, nil, err } - m := new(Milestone) - resp, err := s.client.Do(ctx, req, m) + var m *Milestone + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -122,7 +122,7 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner, repo string, // EditMilestone edits a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#update-a-milestone // //meta:operation PATCH /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) EditMilestone(ctx context.Context, owner, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { @@ -132,8 +132,8 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner, repo string, n return nil, nil, err } - m := new(Milestone) - resp, err := s.client.Do(ctx, req, m) + var m *Milestone + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -143,7 +143,7 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner, repo string, n // DeleteMilestone deletes a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#delete-a-milestone // //meta:operation DELETE /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) DeleteMilestone(ctx context.Context, owner, repo string, number int) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/issues_timeline.go b/vendor/github.com/google/go-github/v85/github/issues_timeline.go similarity index 99% rename from vendor/github.com/google/go-github/v82/github/issues_timeline.go rename to vendor/github.com/google/go-github/v85/github/issues_timeline.go index cea900ee6..f17512136 100644 --- a/vendor/github.com/google/go-github/v82/github/issues_timeline.go +++ b/vendor/github.com/google/go-github/v85/github/issues_timeline.go @@ -173,7 +173,7 @@ type Source struct { // ListIssueTimeline lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/timeline?apiVersion=2022-11-28#list-timeline-events-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/timeline func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/licenses.go b/vendor/github.com/google/go-github/v85/github/licenses.go similarity index 79% rename from vendor/github.com/google/go-github/v82/github/licenses.go rename to vendor/github.com/google/go-github/v85/github/licenses.go index 60dfd71a1..80ef7622b 100644 --- a/vendor/github.com/google/go-github/v82/github/licenses.go +++ b/vendor/github.com/google/go-github/v85/github/licenses.go @@ -13,7 +13,7 @@ import ( // LicensesService handles communication with the license related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/licenses/ +// GitHub API docs: https://docs.github.com/rest/licenses?apiVersion=2022-11-28 type LicensesService service // RepositoryLicense represents the license for a repository. @@ -58,13 +58,26 @@ func (l License) String() string { return Stringify(l) } +// ListLicensesOptions specifies the optional parameters to the LicensesService.List method. +type ListLicensesOptions struct { + Featured *bool `url:"featured,omitempty"` + + ListOptions +} + // List popular open source licenses. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses +// GitHub API docs: https://docs.github.com/rest/licenses/licenses?apiVersion=2022-11-28#get-all-commonly-used-licenses // //meta:operation GET /licenses -func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error) { - req, err := s.client.NewRequest("GET", "licenses", nil) +func (s *LicensesService) List(ctx context.Context, opts *ListLicensesOptions) ([]*License, *Response, error) { + u := "licenses" + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } @@ -80,7 +93,7 @@ func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, erro // Get extended metadata for one license. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license +// GitHub API docs: https://docs.github.com/rest/licenses/licenses?apiVersion=2022-11-28#get-a-license // //meta:operation GET /licenses/{license} func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { @@ -91,8 +104,8 @@ func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License return nil, nil, err } - license := new(License) - resp, err := s.client.Do(ctx, req, license) + var license *License + resp, err := s.client.Do(ctx, req, &license) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/markdown.go b/vendor/github.com/google/go-github/v85/github/markdown.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/markdown.go rename to vendor/github.com/google/go-github/v85/github/markdown.go index 0fd896c6c..7e2ee7f02 100644 --- a/vendor/github.com/google/go-github/v82/github/markdown.go +++ b/vendor/github.com/google/go-github/v85/github/markdown.go @@ -40,17 +40,17 @@ type markdownRenderRequest struct { // Render renders an arbitrary Render document. // -// GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document +// GitHub API docs: https://docs.github.com/rest/markdown/markdown?apiVersion=2022-11-28#render-a-markdown-document // //meta:operation POST /markdown func (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { - request := &markdownRenderRequest{Text: Ptr(text)} + request := &markdownRenderRequest{Text: &text} if opts != nil { if opts.Mode != "" { - request.Mode = Ptr(opts.Mode) + request.Mode = &opts.Mode } if opts.Context != "" { - request.Context = Ptr(opts.Context) + request.Context = &opts.Context } } @@ -59,8 +59,8 @@ func (s *MarkdownService) Render(ctx context.Context, text string, opts *Markdow return "", nil, err } - buf := new(bytes.Buffer) - resp, err := s.client.Do(ctx, req, buf) + var buf bytes.Buffer + resp, err := s.client.Do(ctx, req, &buf) if err != nil { return "", resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/messages.go b/vendor/github.com/google/go-github/v85/github/messages.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/messages.go rename to vendor/github.com/google/go-github/v85/github/messages.go index 21eb7c70c..9bb43c75d 100644 --- a/vendor/github.com/google/go-github/v82/github/messages.go +++ b/vendor/github.com/google/go-github/v85/github/messages.go @@ -19,11 +19,12 @@ import ( "fmt" "hash" "io" + "maps" "mime" "net/http" "net/url" "reflect" - "sort" + "slices" "strings" ) @@ -41,6 +42,10 @@ const ( EventTypeHeader = "X-Github-Event" // DeliveryIDHeader is the GitHub header key used to pass the unique ID for the webhook event. DeliveryIDHeader = "X-Github-Delivery" + + // maxPayloadSize is the maximum size of a GitHub webhook payload. + // GitHub documents a 25 MB limit for webhook payloads. + maxPayloadSize = 25 * 1024 * 1024 ) var ( @@ -145,8 +150,19 @@ func checkMAC(message, messageMAC, key []byte, hashFunc func() hash.Hash) bool { return hmac.Equal(messageMAC, expectedMAC) } -// messageMAC returns the hex-decoded HMAC tag from the signature and its -// corresponding hash function. +// readPayloadBody reads the body from readable, enforcing maxPayloadSize. +func readPayloadBody(readable io.Reader) ([]byte, error) { + body, err := io.ReadAll(io.LimitReader(readable, maxPayloadSize+1)) + if err != nil { + return nil, err + } + if len(body) > maxPayloadSize { + return nil, errors.New("webhook payload exceeds maximum allowed size") + } + return body, nil +} + +// messageMAC returns the MAC method and the corresponding hash function. func messageMAC(signature string) ([]byte, func() hash.Hash, error) { if signature == "" { return nil, nil, errors.New("missing signature") @@ -198,7 +214,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s switch contentType { case "application/json": var err error - if body, err = io.ReadAll(readable); err != nil { + if body, err = readPayloadBody(readable); err != nil { return nil, err } @@ -212,7 +228,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s const payloadFormParam = "payload" var err error - if body, err = io.ReadAll(readable); err != nil { + if body, err = readPayloadBody(readable); err != nil { return nil, err } @@ -334,12 +350,7 @@ func ParseWebHook(messageType string, payload []byte) (any, error) { // MessageTypes returns a sorted list of all the known GitHub event type strings // supported by go-github. func MessageTypes() []string { - types := make([]string, 0, len(eventTypeMapping)) - for t := range eventTypeMapping { - types = append(types, t) - } - sort.Strings(types) - return types + return slices.Sorted(maps.Keys(eventTypeMapping)) } // EventForType returns an empty struct matching the specified GitHub event type. diff --git a/vendor/github.com/google/go-github/v82/github/meta.go b/vendor/github.com/google/go-github/v85/github/meta.go similarity index 83% rename from vendor/github.com/google/go-github/v82/github/meta.go rename to vendor/github.com/google/go-github/v85/github/meta.go index 92c4bcff6..417d76c8b 100644 --- a/vendor/github.com/google/go-github/v82/github/meta.go +++ b/vendor/github.com/google/go-github/v85/github/meta.go @@ -56,6 +56,14 @@ type APIMeta struct { // GitHub Action macOS runner will originate from. ActionsMacos []string `json:"actions_macos,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses + // GitHub Codespaces will originate from. + Codespaces []string `json:"codespaces,omitempty"` + + // An array of IP addresses in CIDR format specifying the IP addresses + // GitHub Copilot will originate from. + Copilot []string `json:"copilot,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses // Dependabot will originate from. Dependabot []string `json:"dependabot,omitempty"` @@ -86,9 +94,16 @@ type APIMetaDomains struct { Copilot []string `json:"copilot,omitempty"` Packages []string `json:"packages,omitempty"` Actions []string `json:"actions,omitempty"` + ActionsInbound *ActionsInboundDomains `json:"actions_inbound,omitempty"` ArtifactAttestations *APIMetaArtifactAttestations `json:"artifact_attestations,omitempty"` } +// ActionsInboundDomains represents the domains associated with GitHub Actions inbound traffic. +type ActionsInboundDomains struct { + FullDomains []string `json:"full_domains,omitempty"` + WildcardDomains []string `json:"wildcard_domains,omitempty"` +} + // APIMetaArtifactAttestations represents the artifact attestation services domains. type APIMetaArtifactAttestations struct { TrustDomain string `json:"trust_domain,omitempty"` @@ -99,7 +114,7 @@ type APIMetaArtifactAttestations struct { // this endpoint on your organization’s GitHub Enterprise installation, this // endpoint provides information about that installation. // -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information +// GitHub API docs: https://docs.github.com/rest/meta/meta?apiVersion=2022-11-28#get-github-meta-information // //meta:operation GET /meta func (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) { @@ -108,8 +123,8 @@ func (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) { return nil, nil, err } - meta := new(APIMeta) - resp, err := s.client.Do(ctx, req, meta) + var meta *APIMeta + resp, err := s.client.Do(ctx, req, &meta) if err != nil { return nil, resp, err } @@ -127,7 +142,7 @@ func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { // Octocat returns an ASCII art octocat with the specified message in a speech // bubble. If message is empty, a random zen phrase is used. // -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat +// GitHub API docs: https://docs.github.com/rest/meta/meta?apiVersion=2022-11-28#get-octocat // //meta:operation GET /octocat func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Response, error) { @@ -141,8 +156,8 @@ func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Res return "", nil, err } - buf := new(bytes.Buffer) - resp, err := s.client.Do(ctx, req, buf) + var buf bytes.Buffer + resp, err := s.client.Do(ctx, req, &buf) if err != nil { return "", resp, err } @@ -162,7 +177,7 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // // See also: https://warpspire.com/posts/taste/ // -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github +// GitHub API docs: https://docs.github.com/rest/meta/meta?apiVersion=2022-11-28#get-the-zen-of-github // //meta:operation GET /zen func (s *MetaService) Zen(ctx context.Context) (string, *Response, error) { @@ -171,8 +186,8 @@ func (s *MetaService) Zen(ctx context.Context) (string, *Response, error) { return "", nil, err } - buf := new(bytes.Buffer) - resp, err := s.client.Do(ctx, req, buf) + var buf bytes.Buffer + resp, err := s.client.Do(ctx, req, &buf) if err != nil { return "", resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/migrations.go b/vendor/github.com/google/go-github/v85/github/migrations.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/migrations.go rename to vendor/github.com/google/go-github/v85/github/migrations.go index 14d014b61..3e9f92b1b 100644 --- a/vendor/github.com/google/go-github/v82/github/migrations.go +++ b/vendor/github.com/google/go-github/v85/github/migrations.go @@ -9,14 +9,12 @@ import ( "context" "errors" "fmt" - "net/http" - "strings" ) // MigrationService provides access to the migration related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/migration/ +// GitHub API docs: https://docs.github.com/rest/migrations?apiVersion=2022-11-28 type MigrationService service // Migration represents a GitHub migration (archival). @@ -90,7 +88,7 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#start-an-organization-migration // //meta:operation POST /orgs/{org}/migrations func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { @@ -98,9 +96,9 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos body := &startMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Ptr(opts.LockRepositories) - body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) - body.ExcludeReleases = Ptr(opts.ExcludeReleases) + body.LockRepositories = &opts.LockRepositories + body.ExcludeAttachments = &opts.ExcludeAttachments + body.ExcludeReleases = &opts.ExcludeReleases body.Exclude = append(body.Exclude, opts.Exclude...) } @@ -111,8 +109,8 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &Migration{} - resp, err := s.client.Do(ctx, req, m) + var m *Migration + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -122,7 +120,7 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#list-organization-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#list-organization-migrations // //meta:operation GET /orgs/{org}/migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { @@ -151,7 +149,7 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#get-an-organization-migration-status // //meta:operation GET /orgs/{org}/migrations/{migration_id} func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { @@ -164,8 +162,8 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &Migration{} - resp, err := s.client.Do(ctx, req, m) + var m *Migration + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -176,7 +174,7 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#download-an-organization-migration-archive // //meta:operation GET /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { @@ -186,35 +184,24 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, if err != nil { return "", err } - req.Header.Set("Accept", mediaTypeMigrationsPreview) - s.client.clientMu.Lock() - defer s.client.clientMu.Unlock() - - // Disable the redirect mechanism because AWS fails if the GitHub auth token is provided. - var loc string - saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { - loc = req.URL.String() - return errors.New("disable redirect") + loc, _, err := s.client.bareDoUntilFound(ctx, req, 10) + if err != nil { + return "", err } - defer func() { s.client.client.CheckRedirect = saveRedirect }() - _, err = s.client.Do(ctx, req, nil) // expect error from disable redirect - if err == nil { + if loc == nil { return "", errors.New("expected redirect, none provided") } - if !strings.Contains(err.Error(), "disable redirect") { - return "", err - } - return loc, nil + + return loc.String(), nil } // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#delete-an-organization-migration-archive // //meta:operation DELETE /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { @@ -235,7 +222,7 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#unlock-an-organization-repository // //meta:operation DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/migrations_source_import.go b/vendor/github.com/google/go-github/v85/github/migrations_source_import.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v85/github/migrations_source_import.go index f484b77d4..bf80249ec 100644 --- a/vendor/github.com/google/go-github/v82/github/migrations_source_import.go +++ b/vendor/github.com/google/go-github/v85/github/migrations_source_import.go @@ -115,7 +115,7 @@ func (i Import) String() string { // SourceImportAuthor identifies an author imported from a source repository. // -// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-commit-authors type SourceImportAuthor struct { ID *int64 `json:"id,omitempty"` RemoteID *string `json:"remote_id,omitempty"` @@ -132,7 +132,7 @@ func (a SourceImportAuthor) String() string { // LargeFile identifies a file larger than 100MB found during a repository import. // -// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-large-files +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-large-files type LargeFile struct { RefName *string `json:"ref_name,omitempty"` Path *string `json:"path,omitempty"` @@ -146,7 +146,7 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#start-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#start-an-import // //meta:operation PUT /repos/{owner}/{repo}/import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { @@ -156,8 +156,8 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(ctx, req, &out) if err != nil { return nil, resp, err } @@ -167,7 +167,7 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-an-import-status +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-an-import-status // //meta:operation GET /repos/{owner}/{repo}/import func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { @@ -177,8 +177,8 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(ctx, req, &out) if err != nil { return nil, resp, err } @@ -188,7 +188,7 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#update-an-import // //meta:operation PATCH /repos/{owner}/{repo}/import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { @@ -198,8 +198,8 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(ctx, req, &out) if err != nil { return nil, resp, err } @@ -219,7 +219,7 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-commit-authors // //meta:operation GET /repos/{owner}/{repo}/import/authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { @@ -242,7 +242,7 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#map-a-commit-author // //meta:operation PATCH /repos/{owner}/{repo}/import/authors/{author_id} func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { @@ -252,8 +252,8 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri return nil, nil, err } - out := new(SourceImportAuthor) - resp, err := s.client.Do(ctx, req, out) + var out *SourceImportAuthor + resp, err := s.client.Do(ctx, req, &out) if err != nil { return nil, resp, err } @@ -265,7 +265,7 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#update-git-lfs-preference // //meta:operation PATCH /repos/{owner}/{repo}/import/lfs func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { @@ -275,8 +275,8 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(ctx, req, &out) if err != nil { return nil, resp, err } @@ -286,7 +286,7 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-large-files +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-large-files // //meta:operation GET /repos/{owner}/{repo}/import/large_files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { @@ -307,7 +307,7 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#cancel-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#cancel-an-import // //meta:operation DELETE /repos/{owner}/{repo}/import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/migrations_user.go b/vendor/github.com/google/go-github/v85/github/migrations_user.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/migrations_user.go rename to vendor/github.com/google/go-github/v85/github/migrations_user.go index 49678fcc0..46aaf7485 100644 --- a/vendor/github.com/google/go-github/v82/github/migrations_user.go +++ b/vendor/github.com/google/go-github/v85/github/migrations_user.go @@ -67,7 +67,7 @@ type startUserMigration struct { // StartUserMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#start-a-user-migration +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#start-a-user-migration // //meta:operation POST /user/migrations func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { @@ -75,8 +75,8 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin body := &startUserMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Ptr(opts.LockRepositories) - body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) + body.LockRepositories = &opts.LockRepositories + body.ExcludeAttachments = &opts.ExcludeAttachments } req, err := s.client.NewRequest("POST", u, body) @@ -86,8 +86,8 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &UserMigration{} - resp, err := s.client.Do(ctx, req, m) + var m *UserMigration + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -97,7 +97,7 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#list-user-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#list-user-migrations // //meta:operation GET /user/migrations func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) { @@ -126,7 +126,7 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt // UserMigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#get-a-user-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#get-a-user-migration-status // //meta:operation GET /user/migrations/{migration_id} func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) { @@ -139,8 +139,8 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &UserMigration{} - resp, err := s.client.Do(ctx, req, m) + var m *UserMigration + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -151,7 +151,7 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* // UserMigrationArchiveURL gets the URL for a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#download-a-user-migration-archive // //meta:operation GET /user/migrations/{migration_id}/archive func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) { @@ -164,8 +164,6 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &UserMigration{} - var loc string originalRedirect := s.client.client.CheckRedirect s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { @@ -175,10 +173,13 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 defer func() { s.client.client.CheckRedirect = originalRedirect }() - resp, err := s.client.Do(ctx, req, m) + + var m *UserMigration + resp, err := s.client.Do(ctx, req, &m) if err == nil { return "", errors.New("expected redirect, none provided") } + loc = resp.Header.Get("Location") return loc, nil } @@ -186,7 +187,7 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 // DeleteUserMigration will delete a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#delete-a-user-migration-archive // //meta:operation DELETE /user/migrations/{migration_id}/archive func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) { @@ -207,7 +208,7 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#unlock-a-user-repository +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#unlock-a-user-repository // //meta:operation DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs.go b/vendor/github.com/google/go-github/v85/github/orgs.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/orgs.go rename to vendor/github.com/google/go-github/v85/github/orgs.go index 185d03930..797780585 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs.go +++ b/vendor/github.com/google/go-github/v85/github/orgs.go @@ -13,7 +13,7 @@ import ( // OrganizationsService provides access to the organization related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/orgs/ +// GitHub API docs: https://docs.github.com/rest/orgs?apiVersion=2022-11-28 type OrganizationsService service // Organization represents a GitHub organization account. @@ -153,13 +153,11 @@ func (p Plan) String() string { // OrganizationsListOptions specifies the optional parameters to the // OrganizationsService.ListAll method. type OrganizationsListOptions struct { - // Since filters Organizations by ID. + // An organization ID. Only return organizations with an ID greater than this ID. Since int64 `url:"since,omitempty"` - // Note: Pagination is powered exclusively by the Since parameter, - // ListOptions.Page has no effect. - // ListOptions.PerPage controls an undocumented GitHub API parameter. - ListOptions + // The number of results per page (max 100). + PerPage int `url:"per_page,omitempty"` } // ListAll lists all organizations, in the order that they were created on GitHub. @@ -168,7 +166,7 @@ type OrganizationsListOptions struct { // listing the next set of organizations, use the ID of the last-returned organization // as the opts.Since parameter for the next call. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations // //meta:operation GET /organizations func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) { @@ -193,9 +191,9 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations-for-a-user // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations-for-the-authenticated-user // //meta:operation GET /user/orgs //meta:operation GET /users/{username}/orgs @@ -227,7 +225,7 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List // Get fetches an organization by name. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#get-an-organization // //meta:operation GET /orgs/{org} func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) { @@ -239,13 +237,13 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati req.Header.Set("Accept", mediaTypeMemberAllowedRepoCreationTypePreview) - organization := new(Organization) - resp, err := s.client.Do(ctx, req, organization) + var o *Organization + resp, err := s.client.Do(ctx, req, &o) if err != nil { return nil, resp, err } - return organization, resp, nil + return o, resp, nil } // GetByID fetches an organization. @@ -260,18 +258,18 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza return nil, nil, err } - organization := new(Organization) - resp, err := s.client.Do(ctx, req, organization) + var org *Organization + resp, err := s.client.Do(ctx, req, &org) if err != nil { return nil, resp, err } - return organization, resp, nil + return org, resp, nil } // Edit an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#update-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#update-an-organization // //meta:operation PATCH /orgs/{org} func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { @@ -283,8 +281,8 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ req.Header.Set("Accept", mediaTypeMemberAllowedRepoCreationTypePreview) - o := new(Organization) - resp, err := s.client.Do(ctx, req, o) + var o *Organization + resp, err := s.client.Do(ctx, req, &o) if err != nil { return nil, resp, err } @@ -294,7 +292,7 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ // Delete an organization by name. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#delete-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#delete-an-organization // //meta:operation DELETE /orgs/{org} func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) { @@ -309,7 +307,7 @@ func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Respons // ListInstallations lists installations for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-app-installations-for-an-organization // //meta:operation GET /orgs/{org}/installations func (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) { @@ -325,8 +323,8 @@ func (s *OrganizationsService) ListInstallations(ctx context.Context, org string return nil, nil, err } - result := new(OrganizationInstallations) - resp, err := s.client.Do(ctx, req, result) + var result *OrganizationInstallations + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v85/github/orgs_actions_allowed.go similarity index 87% rename from vendor/github.com/google/go-github/v82/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v85/github/orgs_actions_allowed.go index 9c42df645..fdec0c73a 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_actions_allowed.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_actions_allowed.go @@ -13,7 +13,7 @@ import ( // // Deprecated: please use `client.Actions.GetActionsAllowed` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { @@ -25,7 +25,7 @@ func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string // // Deprecated: please use `client.Actions.UpdateActionsAllowed` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v85/github/orgs_actions_permissions.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v85/github/orgs_actions_permissions.go index 60abbeec3..8f2531886 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_actions_permissions.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_actions_permissions.go @@ -13,7 +13,7 @@ import ( // // Deprecated: please use `client.Actions.GetActionsPermissions` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { @@ -25,7 +25,7 @@ func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org st // // Deprecated: please use `client.Actions.UpdateActionsPermissions` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions func (s *OrganizationsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { diff --git a/vendor/github.com/google/go-github/v85/github/orgs_artifacts.go b/vendor/github.com/google/go-github/v85/github/orgs_artifacts.go new file mode 100644 index 000000000..35694c0ad --- /dev/null +++ b/vendor/github.com/google/go-github/v85/github/orgs_artifacts.go @@ -0,0 +1,219 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// DeploymentRuntimeRisk represents the runtime risk of a deployment. +type DeploymentRuntimeRisk string + +const ( + DeploymentRuntimeRiskCriticalResource DeploymentRuntimeRisk = "critical-resource" + DeploymentRuntimeRiskInternetExposed DeploymentRuntimeRisk = "internet-exposed" + DeploymentRuntimeRiskLateralMovement DeploymentRuntimeRisk = "lateral-movement" + DeploymentRuntimeRiskSensitiveData DeploymentRuntimeRisk = "sensitive-data" +) + +// ArtifactDeploymentRecord represents a GitHub artifact deployment record. +type ArtifactDeploymentRecord struct { + ID *int64 `json:"id,omitempty"` + Digest *string `json:"digest,omitempty"` + LogicalEnvironment *string `json:"logical_environment,omitempty"` + PhysicalEnvironment *string `json:"physical_environment,omitempty"` + Cluster *string `json:"cluster,omitempty"` + DeploymentName *string `json:"deployment_name,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + RuntimeRisks []DeploymentRuntimeRisk `json:"runtime_risks,omitempty"` + AttestationID *int64 `json:"attestation_id,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// CreateArtifactDeploymentRequest represents the request body for creating a deployment record. +type CreateArtifactDeploymentRequest struct { + Name string `json:"name"` + Digest string `json:"digest"` + Version *string `json:"version,omitempty"` + Status string `json:"status"` + LogicalEnvironment string `json:"logical_environment"` + PhysicalEnvironment *string `json:"physical_environment,omitempty"` + Cluster *string `json:"cluster,omitempty"` + DeploymentName string `json:"deployment_name"` + Tags map[string]string `json:"tags,omitempty"` + RuntimeRisks []DeploymentRuntimeRisk `json:"runtime_risks,omitempty"` + GithubRepository *string `json:"github_repository,omitempty"` +} + +// ArtifactDeploymentResponse represents the response for deployment records. +type ArtifactDeploymentResponse struct { + TotalCount *int `json:"total_count,omitempty"` + DeploymentRecords []*ArtifactDeploymentRecord `json:"deployment_records,omitempty"` +} + +// ClusterArtifactDeployment represents a deployment within a cluster record request. +type ClusterArtifactDeployment struct { + Name string `json:"name"` + Digest string `json:"digest"` + Version *string `json:"version,omitempty"` + Status string `json:"status"` + DeploymentName string `json:"deployment_name"` + Tags map[string]string `json:"tags,omitempty"` + RuntimeRisks []DeploymentRuntimeRisk `json:"runtime_risks,omitempty"` + GithubRepository *string `json:"github_repository,omitempty"` +} + +// ClusterDeploymentRecordsRequest represents the request body for setting cluster deployment records. +type ClusterDeploymentRecordsRequest struct { + LogicalEnvironment string `json:"logical_environment"` + PhysicalEnvironment *string `json:"physical_environment,omitempty"` + Deployments []*ClusterArtifactDeployment `json:"deployments"` +} + +// ArtifactStorageRecord represents a GitHub artifact storage record. +type ArtifactStorageRecord struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Digest *string `json:"digest,omitempty"` + ArtifactURL *string `json:"artifact_url,omitempty"` + RegistryURL *string `json:"registry_url,omitempty"` + Repository *string `json:"repository,omitempty"` + Status *string `json:"status,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// CreateArtifactStorageRequest represents the request body for creating a storage record. +type CreateArtifactStorageRequest struct { + Name string `json:"name"` + Digest string `json:"digest"` + Version *string `json:"version,omitempty"` + ArtifactURL *string `json:"artifact_url,omitempty"` + Path *string `json:"path,omitempty"` + RegistryURL string `json:"registry_url"` + Repository *string `json:"repository,omitempty"` + Status *string `json:"status,omitempty"` + GithubRepository *string `json:"github_repository,omitempty"` +} + +// ArtifactStorageResponse represents the response for storage records. +type ArtifactStorageResponse struct { + TotalCount *int `json:"total_count,omitempty"` + StorageRecords []*ArtifactStorageRecord `json:"storage_records,omitempty"` +} + +// CreateArtifactDeploymentRecord creates or updates deployment records for an artifact associated with an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#create-an-artifact-deployment-record +// +//meta:operation POST /orgs/{org}/artifacts/metadata/deployment-record +func (s *OrganizationsService) CreateArtifactDeploymentRecord(ctx context.Context, org string, record CreateArtifactDeploymentRequest) (*ArtifactDeploymentResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/artifacts/metadata/deployment-record", org) + req, err := s.client.NewRequest("POST", u, record) + if err != nil { + return nil, nil, err + } + + var v *ArtifactDeploymentResponse + resp, err := s.client.Do(ctx, req, &v) + if err != nil { + return nil, resp, err + } + + return v, resp, nil +} + +// SetClusterDeploymentRecords sets deployment records for a given cluster. +// +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#set-cluster-deployment-records +// +//meta:operation POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster} +func (s *OrganizationsService) SetClusterDeploymentRecords(ctx context.Context, org, cluster string, request ClusterDeploymentRecordsRequest) (*ArtifactDeploymentResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/artifacts/metadata/deployment-record/cluster/%v", org, cluster) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + var v *ArtifactDeploymentResponse + resp, err := s.client.Do(ctx, req, &v) + if err != nil { + return nil, resp, err + } + + return v, resp, nil +} + +// CreateArtifactStorageRecord creates metadata storage records for artifacts. +// +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#create-artifact-metadata-storage-record +// +//meta:operation POST /orgs/{org}/artifacts/metadata/storage-record +func (s *OrganizationsService) CreateArtifactStorageRecord(ctx context.Context, org string, record CreateArtifactStorageRequest) (*ArtifactStorageResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/artifacts/metadata/storage-record", org) + req, err := s.client.NewRequest("POST", u, record) + if err != nil { + return nil, nil, err + } + + var v *ArtifactStorageResponse + resp, err := s.client.Do(ctx, req, &v) + if err != nil { + return nil, resp, err + } + + return v, resp, nil +} + +// ListArtifactDeploymentRecords lists deployment records for an artifact metadata. +// +// subjectDigest is SHA256 digest of the artifact, in the form sha256:HEX_DIGEST. +// +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#list-artifact-deployment-records +// +//meta:operation GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records +func (s *OrganizationsService) ListArtifactDeploymentRecords(ctx context.Context, org, subjectDigest string) (*ArtifactDeploymentResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/artifacts/%v/metadata/deployment-records", org, subjectDigest) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var v *ArtifactDeploymentResponse + resp, err := s.client.Do(ctx, req, &v) + if err != nil { + return nil, resp, err + } + + return v, resp, nil +} + +// ListArtifactStorageRecords lists artifact storage records with a given subject digest. +// +// subjectDigest is SHA256 digest of the artifact, in the form sha256:HEX_DIGEST. +// +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#list-artifact-storage-records +// +//meta:operation GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records +func (s *OrganizationsService) ListArtifactStorageRecords(ctx context.Context, org, subjectDigest string) (*ArtifactStorageResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/artifacts/%v/metadata/storage-records", org, subjectDigest) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var v *ArtifactStorageResponse + resp, err := s.client.Do(ctx, req, &v) + if err != nil { + return nil, resp, err + } + + return v, resp, nil +} diff --git a/vendor/github.com/google/go-github/v82/github/orgs_attestations.go b/vendor/github.com/google/go-github/v85/github/orgs_attestations.go similarity index 96% rename from vendor/github.com/google/go-github/v82/github/orgs_attestations.go rename to vendor/github.com/google/go-github/v85/github/orgs_attestations.go index 1a7a1d5c9..220add269 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_attestations.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_attestations.go @@ -14,7 +14,7 @@ import ( // with a given subject digest that are associated with repositories // owned by an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/attestations#list-attestations +// GitHub API docs: https://docs.github.com/rest/orgs/attestations?apiVersion=2022-11-28#list-attestations // //meta:operation GET /orgs/{org}/attestations/{subject_digest} func (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v85/github/orgs_audit_log.go similarity index 98% rename from vendor/github.com/google/go-github/v82/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v85/github/orgs_audit_log.go index 8aae4ef38..edffd650d 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_audit_log.go @@ -119,7 +119,7 @@ func (a *AuditEntry) MarshalJSON() ([]byte, error) { // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization // //meta:operation GET /orgs/{org}/audit-log func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_codesecurity_configurations.go b/vendor/github.com/google/go-github/v85/github/orgs_codesecurity_configurations.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/orgs_codesecurity_configurations.go rename to vendor/github.com/google/go-github/v85/github/orgs_codesecurity_configurations.go index d1ed6e257..dbb70d165 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_codesecurity_configurations.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_codesecurity_configurations.go @@ -102,18 +102,18 @@ type RepositoryCodeSecurityConfiguration struct { // per page (max 100 per GitHub API docs). type ListOrgCodeSecurityConfigurationOptions struct { // A cursor, as given in the Link header. If specified, the query only searches for security configurations before this cursor. - Before *string `url:"before,omitempty"` + Before string `url:"before,omitempty"` // A cursor, as given in the Link header. If specified, the query only searches for security configurations after this cursor. - After *string `url:"after,omitempty"` + After string `url:"after,omitempty"` // For paginated result sets, the number of results to include per page. - PerPage *int `url:"per_page,omitempty"` + PerPage int `url:"per_page,omitempty"` // The target type of the code security configurations to get. // // `target_type` defaults to all, can be one of `global`, `all` - TargetType *string `url:"target_type,omitempty"` + TargetType string `url:"target_type,omitempty"` } // ListCodeSecurityConfigurationRepositoriesOptions specifies optional parameters to list repositories for security configurations for orgs and enterprises. @@ -126,23 +126,23 @@ type ListOrgCodeSecurityConfigurationOptions struct { // per page (max 100 per GitHub API docs). type ListCodeSecurityConfigurationRepositoriesOptions struct { // A cursor, as given in the Link header. If specified, the query only searches for repositories before this cursor. - Before *string `url:"before,omitempty"` + Before string `url:"before,omitempty"` // A cursor, as given in the Link header. If specified, the query only searches for repositories after this cursor. - After *string `url:"after,omitempty"` + After string `url:"after,omitempty"` // For paginated result sets, the number of results to include per page. - PerPage *int `url:"per_page,omitempty"` + PerPage int `url:"per_page,omitempty"` // A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. // // `status` defaults to all, can be one of `all`, `attached`, `attaching`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise` and also `detached` but only for the org endpoint. - Status *string `url:"status,omitempty"` + Status string `url:"status,omitempty"` } // ListCodeSecurityConfigurations gets code security configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-code-security-configurations-for-an-organization // //meta:operation GET /orgs/{org}/code-security/configurations func (s *OrganizationsService) ListCodeSecurityConfigurations(ctx context.Context, org string, opts *ListOrgCodeSecurityConfigurationOptions) ([]*CodeSecurityConfiguration, *Response, error) { @@ -167,7 +167,7 @@ func (s *OrganizationsService) ListCodeSecurityConfigurations(ctx context.Contex // CreateCodeSecurityConfiguration creates a code security configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#create-a-code-security-configuration // //meta:operation POST /orgs/{org}/code-security/configurations func (s *OrganizationsService) CreateCodeSecurityConfiguration(ctx context.Context, org string, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { @@ -188,7 +188,7 @@ func (s *OrganizationsService) CreateCodeSecurityConfiguration(ctx context.Conte // ListDefaultCodeSecurityConfigurations gets default code security configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-default-code-security-configurations // //meta:operation GET /orgs/{org}/code-security/configurations/defaults func (s *OrganizationsService) ListDefaultCodeSecurityConfigurations(ctx context.Context, org string) ([]*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { @@ -209,7 +209,7 @@ func (s *OrganizationsService) ListDefaultCodeSecurityConfigurations(ctx context // DetachCodeSecurityConfigurationsFromRepositories detaches code security configuration from an organization's repositories. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#detach-configurations-from-repositories // //meta:operation DELETE /orgs/{org}/code-security/configurations/detach func (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories(ctx context.Context, org string, repoIDs []int64) (*Response, error) { @@ -230,7 +230,7 @@ func (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories( // GetCodeSecurityConfiguration gets a code security configuration available in an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-a-code-security-configuration // //meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id} func (s *OrganizationsService) GetCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64) (*CodeSecurityConfiguration, *Response, error) { @@ -251,7 +251,7 @@ func (s *OrganizationsService) GetCodeSecurityConfiguration(ctx context.Context, // UpdateCodeSecurityConfiguration updates a code security configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#update-a-code-security-configuration // //meta:operation PATCH /orgs/{org}/code-security/configurations/{configuration_id} func (s *OrganizationsService) UpdateCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { @@ -272,7 +272,7 @@ func (s *OrganizationsService) UpdateCodeSecurityConfiguration(ctx context.Conte // DeleteCodeSecurityConfiguration deletes a code security configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#delete-a-code-security-configuration // //meta:operation DELETE /orgs/{org}/code-security/configurations/{configuration_id} func (s *OrganizationsService) DeleteCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64) (*Response, error) { @@ -291,7 +291,7 @@ func (s *OrganizationsService) DeleteCodeSecurityConfiguration(ctx context.Conte // AttachCodeSecurityConfigurationToRepositories attaches code security configurations to repositories for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#attach-a-configuration-to-repositories // //meta:operation POST /orgs/{org}/code-security/configurations/{configuration_id}/attach func (s *OrganizationsService) AttachCodeSecurityConfigurationToRepositories(ctx context.Context, org string, configurationID int64, scope string, repoIDs []int64) (*Response, error) { @@ -313,7 +313,7 @@ func (s *OrganizationsService) AttachCodeSecurityConfigurationToRepositories(ctx // SetDefaultCodeSecurityConfiguration sets a code security configuration as the default for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#set-a-code-security-configuration-as-a-default-for-an-organization // //meta:operation PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults func (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64, newReposParam string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { @@ -335,7 +335,7 @@ func (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.C // ListCodeSecurityConfigurationRepositories gets repositories associated with a code security configuration. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-repositories-associated-with-a-code-security-configuration // //meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories func (s *OrganizationsService) ListCodeSecurityConfigurationRepositories(ctx context.Context, org string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) ([]*RepositoryAttachment, *Response, error) { @@ -361,7 +361,7 @@ func (s *OrganizationsService) ListCodeSecurityConfigurationRepositories(ctx con // GetCodeSecurityConfigurationForRepository gets code security configuration that manages a repository's code security settings. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-the-code-security-configuration-associated-with-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-security-configuration func (s *OrganizationsService) GetCodeSecurityConfigurationForRepository(ctx context.Context, org, repo string) (*RepositoryCodeSecurityConfiguration, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_credential_authorizations.go b/vendor/github.com/google/go-github/v85/github/orgs_credential_authorizations.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/orgs_credential_authorizations.go rename to vendor/github.com/google/go-github/v85/github/orgs_credential_authorizations.go index 326922c3b..895bea872 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_credential_authorizations.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_credential_authorizations.go @@ -57,7 +57,7 @@ type CredentialAuthorization struct { // CredentialAuthorizationsListOptions adds the Login option as supported by the // list SAML SSO authorizations for organizations endpoint alongside paging options // such as Page and PerPage. -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization type CredentialAuthorizationsListOptions struct { ListOptions // For credentials authorizations for an organization, limit the list of authorizations to a specific login (aka github username) @@ -67,7 +67,7 @@ type CredentialAuthorizationsListOptions struct { // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization // //meta:operation GET /orgs/{org}/credential-authorizations func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *CredentialAuthorizationsListOptions) ([]*CredentialAuthorization, *Response, error) { @@ -94,7 +94,7 @@ func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, // RemoveCredentialAuthorization revokes the SAML SSO authorization for a given // credential within an organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization // //meta:operation DELETE /orgs/{org}/credential-authorizations/{credential_id} func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_custom_repository_roles.go b/vendor/github.com/google/go-github/v85/github/orgs_custom_repository_roles.go similarity index 71% rename from vendor/github.com/google/go-github/v82/github/orgs_custom_repository_roles.go rename to vendor/github.com/google/go-github/v85/github/orgs_custom_repository_roles.go index 44408db14..406810951 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_custom_repository_roles.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_custom_repository_roles.go @@ -38,10 +38,16 @@ type CreateOrUpdateCustomRepoRoleOptions struct { Permissions []string `json:"permissions"` } +// RepoFineGrainedPermission represents a fine-grained permission that can be used in a custom repository role. +type RepoFineGrainedPermission struct { + Name string `json:"name"` + Description string `json:"description"` +} + // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-custom-repository-roles-in-an-organization // //meta:operation GET /orgs/{org}/custom-repository-roles func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { @@ -52,8 +58,8 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri return nil, nil, err } - customRepoRoles := new(OrganizationCustomRepoRoles) - resp, err := s.client.Do(ctx, req, customRepoRoles) + var customRepoRoles *OrganizationCustomRepoRoles + resp, err := s.client.Do(ctx, req, &customRepoRoles) if err != nil { return nil, resp, err } @@ -64,7 +70,7 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri // GetCustomRepoRole gets a custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#get-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#get-a-custom-repository-role // //meta:operation GET /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string, roleID int64) (*CustomRepoRoles, *Response, error) { @@ -75,8 +81,8 @@ func (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string return nil, nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return nil, resp, err } @@ -87,7 +93,7 @@ func (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#create-a-custom-repository-role // //meta:operation POST /orgs/{org}/custom-repository-roles func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { @@ -98,8 +104,8 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str return nil, nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return nil, resp, err } @@ -110,7 +116,7 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // UpdateCustomRepoRole updates a custom repository role in this organization. // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#update-a-custom-repository-role // //meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { @@ -121,8 +127,8 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org str return nil, nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return nil, resp, err } @@ -133,7 +139,7 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org str // DeleteCustomRepoRole deletes an existing custom repository role in this organization. // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#delete-a-custom-repository-role // //meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) { @@ -144,11 +150,34 @@ func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org str return nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return resp, err } return resp, nil } + +// ListRepositoryFineGrainedPermissions lists the fine-grained permissions that can be used in custom repository roles for an organization. +// The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/repository-fine-grained-permissions +func (s *OrganizationsService) ListRepositoryFineGrainedPermissions(ctx context.Context, org string) ([]*RepoFineGrainedPermission, *Response, error) { + u := fmt.Sprintf("orgs/%v/repository-fine-grained-permissions", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var perms []*RepoFineGrainedPermission + resp, err := s.client.Do(ctx, req, &perms) + if err != nil { + return nil, resp, err + } + + return perms, resp, nil +} diff --git a/vendor/github.com/google/go-github/v82/github/orgs_hooks.go b/vendor/github.com/google/go-github/v85/github/orgs_hooks.go similarity index 78% rename from vendor/github.com/google/go-github/v82/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v85/github/orgs_hooks.go index e3bb25e78..7a70adfa9 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_hooks.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_hooks.go @@ -13,7 +13,7 @@ import ( // ListHooks lists all Hooks for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#list-organization-webhooks // //meta:operation GET /orgs/{org}/hooks func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) { @@ -39,7 +39,7 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#get-an-organization-webhook // //meta:operation GET /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) { @@ -49,8 +49,8 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 return nil, nil, err } - hook := new(Hook) - resp, err := s.client.Do(ctx, req, hook) + var hook *Hook + resp, err := s.client.Do(ctx, req, &hook) if err != nil { return nil, resp, err } @@ -64,7 +64,7 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#create-an-organization-webhook // //meta:operation POST /orgs/{org}/hooks func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { @@ -86,8 +86,8 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + var h *Hook + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -97,7 +97,7 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#update-an-organization-webhook // //meta:operation PATCH /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) { @@ -107,8 +107,8 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + var h *Hook + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -118,7 +118,7 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#ping-an-organization-webhook // //meta:operation POST /orgs/{org}/hooks/{hook_id}/pings func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) { @@ -133,7 +133,7 @@ func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int6 // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#delete-an-organization-webhook // //meta:operation DELETE /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_hooks_configuration.go b/vendor/github.com/google/go-github/v85/github/orgs_hooks_configuration.go similarity index 75% rename from vendor/github.com/google/go-github/v82/github/orgs_hooks_configuration.go rename to vendor/github.com/google/go-github/v85/github/orgs_hooks_configuration.go index aeb616fc4..22bee7fb8 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_hooks_configuration.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_hooks_configuration.go @@ -12,7 +12,7 @@ import ( // GetHookConfiguration returns the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization // //meta:operation GET /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { @@ -22,8 +22,8 @@ func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org str return nil, nil, err } - config := new(HookConfig) - resp, err := s.client.Do(ctx, req, config) + var config *HookConfig + resp, err := s.client.Do(ctx, req, &config) if err != nil { return nil, resp, err } @@ -33,7 +33,7 @@ func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org str // EditHookConfiguration updates the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization // //meta:operation PATCH /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { @@ -43,8 +43,8 @@ func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org st return nil, nil, err } - c := new(HookConfig) - resp, err := s.client.Do(ctx, req, c) + var c *HookConfig + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v85/github/orgs_hooks_deliveries.go similarity index 79% rename from vendor/github.com/google/go-github/v82/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v85/github/orgs_hooks_deliveries.go index c1c301240..be92aea1f 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#list-deliveries-for-an-organization-webhook // //meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { @@ -38,7 +38,7 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin // GetHookDelivery returns a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-delivery-for-an-organization-webhook // //meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { @@ -48,8 +48,8 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -59,7 +59,7 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string // RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#redeliver-a-delivery-for-an-organization-webhook // //meta:operation POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { @@ -69,8 +69,8 @@ func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/orgs_immutable_releases.go b/vendor/github.com/google/go-github/v85/github/orgs_immutable_releases.go similarity index 87% rename from vendor/github.com/google/go-github/v82/github/orgs_immutable_releases.go rename to vendor/github.com/google/go-github/v85/github/orgs_immutable_releases.go index 4e305947d..501137c52 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_immutable_releases.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_immutable_releases.go @@ -35,7 +35,7 @@ type setImmutableReleasesRepositoriesOptions struct { // GetImmutableReleasesSettings returns the immutable releases configuration that applies to repositories within the given organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-immutable-releases-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#get-immutable-releases-settings-for-an-organization // //meta:operation GET /orgs/{org}/settings/immutable-releases func (s *OrganizationsService) GetImmutableReleasesSettings(ctx context.Context, org string) (*ImmutableReleaseSettings, *Response, error) { @@ -57,7 +57,7 @@ func (s *OrganizationsService) GetImmutableReleasesSettings(ctx context.Context, // UpdateImmutableReleasesSettings sets immutable releases settings for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#set-immutable-releases-settings-for-an-organization // //meta:operation PUT /orgs/{org}/settings/immutable-releases func (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Context, org string, opts ImmutableReleasePolicy) (*Response, error) { @@ -78,7 +78,7 @@ func (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Conte // ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-selected-repositories-for-immutable-releases-enforcement +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-selected-repositories-for-immutable-releases-enforcement // //meta:operation GET /orgs/{org}/settings/immutable-releases/repositories func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Context, org string, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -106,7 +106,7 @@ func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Cont // SetImmutableReleaseRepositories sets selected repositories for immutable releases enforcement. // It requires the organization's immutable releases policy for enforced_repositories to be set to "selected". // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-selected-repositories-for-immutable-releases-enforcement +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#set-selected-repositories-for-immutable-releases-enforcement // //meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) { @@ -132,7 +132,7 @@ func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Conte // EnableRepositoryForImmutableRelease enables a selected repository for immutable releases in an organization. // It requires enforced_repositories to be set to "selected". // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#enable-a-selected-repository-for-immutable-releases-in-an-organization // //meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id} func (s *OrganizationsService) EnableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) { @@ -154,7 +154,7 @@ func (s *OrganizationsService) EnableRepositoryForImmutableRelease(ctx context.C // DisableRepositoryForImmutableRelease removes a repository from the organization's selected list for immutable releases enforcement. // It requires enforced_repositories to be set to "selected". // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#disable-a-selected-repository-for-immutable-releases-in-an-organization // //meta:operation DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id} func (s *OrganizationsService) DisableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_issue_types.go b/vendor/github.com/google/go-github/v85/github/orgs_issue_types.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/orgs_issue_types.go rename to vendor/github.com/google/go-github/v85/github/orgs_issue_types.go index 0819c2183..791f55ad5 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_issue_types.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_issue_types.go @@ -21,7 +21,7 @@ type CreateOrUpdateIssueTypesOptions struct { // ListIssueTypes lists all issue types for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#list-issue-types-for-an-organization // //meta:operation GET /orgs/{org}/issue-types func (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ([]*IssueType, *Response, error) { @@ -43,7 +43,7 @@ func (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ( // CreateIssueType creates a new issue type for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#create-issue-type-for-an-organization // //meta:operation POST /orgs/{org}/issue-types func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, opts *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { @@ -53,8 +53,8 @@ func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, return nil, nil, err } - issueType := new(IssueType) - resp, err := s.client.Do(ctx, req, issueType) + var issueType *IssueType + resp, err := s.client.Do(ctx, req, &issueType) if err != nil { return nil, resp, err } @@ -64,7 +64,7 @@ func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, // UpdateIssueType updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#update-issue-type-for-an-organization // //meta:operation PUT /orgs/{org}/issue-types/{issue_type_id} func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, issueTypeID int64, opts *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { @@ -74,8 +74,8 @@ func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, return nil, nil, err } - issueType := new(IssueType) - resp, err := s.client.Do(ctx, req, issueType) + var issueType *IssueType + resp, err := s.client.Do(ctx, req, &issueType) if err != nil { return nil, resp, err } @@ -85,7 +85,7 @@ func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, // DeleteIssueType deletes an issue type for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#delete-issue-type-for-an-organization // //meta:operation DELETE /orgs/{org}/issue-types/{issue_type_id} func (s *OrganizationsService) DeleteIssueType(ctx context.Context, org string, issueTypeID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_members.go b/vendor/github.com/google/go-github/v85/github/orgs_members.go similarity index 84% rename from vendor/github.com/google/go-github/v82/github/orgs_members.go rename to vendor/github.com/google/go-github/v85/github/orgs_members.go index 837a8f446..804f1cbf9 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_members.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_members.go @@ -71,9 +71,9 @@ type ListMembersOptions struct { // user is an owner of the organization, this will return both concealed and // public members; otherwise, it will only return public members. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-organization-members // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-public-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-public-organization-members // //meta:operation GET /orgs/{org}/members //meta:operation GET /orgs/{org}/public_members @@ -105,7 +105,7 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts // IsMember checks if a user is a member of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#check-organization-membership-for-a-user // //meta:operation GET /orgs/{org}/members/{username} func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) { @@ -122,7 +122,7 @@ func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) ( // IsPublicMember checks if a user is a public member of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#check-public-organization-membership-for-a-user // //meta:operation GET /orgs/{org}/public_members/{username} func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) { @@ -139,7 +139,7 @@ func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user str // RemoveMember removes a user from all teams of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-an-organization-member +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#remove-an-organization-member // //meta:operation DELETE /orgs/{org}/members/{username} func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) { @@ -154,7 +154,7 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin // CancelInvite cancels an organization invitation. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#cancel-an-organization-invitation // //meta:operation DELETE /orgs/{org}/invitations/{invitation_id} func (s *OrganizationsService) CancelInvite(ctx context.Context, org string, invitationID int64) (*Response, error) { @@ -169,7 +169,7 @@ func (s *OrganizationsService) CancelInvite(ctx context.Context, org string, inv // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // -// GitHub API docs: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#set-public-organization-membership-for-the-authenticated-user // //meta:operation PUT /orgs/{org}/public_members/{username} func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) { @@ -184,7 +184,7 @@ func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, use // ConcealMembership conceals a user's membership in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#remove-public-organization-membership-for-the-authenticated-user // //meta:operation DELETE /orgs/{org}/public_members/{username} func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) { @@ -209,7 +209,7 @@ type ListOrgMembershipsOptions struct { // ListOrgMemberships lists the organization memberships for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-organization-memberships-for-the-authenticated-user // //meta:operation GET /user/memberships/orgs func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) { @@ -237,9 +237,9 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#get-an-organization-membership-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#get-organization-membership-for-a-user // //meta:operation GET /orgs/{org}/memberships/{username} //meta:operation GET /user/memberships/orgs/{org} @@ -256,8 +256,8 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s return nil, nil, err } - membership := new(Membership) - resp, err := s.client.Do(ctx, req, membership) + var membership *Membership + resp, err := s.client.Do(ctx, req, &membership) if err != nil { return nil, resp, err } @@ -269,9 +269,9 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s // Passing an empty string for user will edit the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#set-organization-membership-for-a-user // -// GitHub API docs: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#update-an-organization-membership-for-the-authenticated-user // //meta:operation PUT /orgs/{org}/memberships/{username} //meta:operation PATCH /user/memberships/orgs/{org} @@ -290,8 +290,8 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org return nil, nil, err } - m := new(Membership) - resp, err := s.client.Do(ctx, req, m) + var m *Membership + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -302,7 +302,7 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org // RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#remove-organization-membership-for-a-user // //meta:operation DELETE /orgs/{org}/memberships/{username} func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) { @@ -317,7 +317,7 @@ func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, or // ListPendingOrgInvitations returns a list of pending invitations. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-pending-organization-invitations // //meta:operation GET /orgs/{org}/invitations func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { @@ -365,7 +365,7 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#create-an-organization-invitation +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#create-an-organization-invitation // //meta:operation POST /orgs/{org}/invitations func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { @@ -388,7 +388,7 @@ func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org stri // ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-organization-invitation-teams // //meta:operation GET /orgs/{org}/invitations/{invitation_id}/teams func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) { @@ -414,7 +414,7 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, // ListFailedOrgInvitations returns a list of failed invitations. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-failed-organization-invitations // //meta:operation GET /orgs/{org}/failed_invitations func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_network_configurations.go b/vendor/github.com/google/go-github/v85/github/orgs_network_configurations.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/orgs_network_configurations.go rename to vendor/github.com/google/go-github/v85/github/orgs_network_configurations.go index 82a819c20..79aa011ae 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_network_configurations.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_network_configurations.go @@ -89,10 +89,7 @@ func validateNetworkConfigurationRequest(req NetworkConfigurationRequest) error } networkIDs := req.NetworkSettingsIDs - if err := validateNetworkSettingsID(networkIDs); err != nil { - return err - } - return nil + return validateNetworkSettingsID(networkIDs) } // NetworkConfigurationRequest represents a request to create or update a network configuration for an organization. @@ -104,7 +101,7 @@ type NetworkConfigurationRequest struct { // ListNetworkConfigurations lists all hosted compute network configurations configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#list-hosted-compute-network-configurations-for-an-organization // //meta:operation GET /orgs/{org}/settings/network-configurations func (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, org string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { @@ -119,17 +116,18 @@ func (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, or return nil, nil, err } - configurations := &NetworkConfigurations{} - resp, err := s.client.Do(ctx, req, configurations) + var configurations *NetworkConfigurations + resp, err := s.client.Do(ctx, req, &configurations) if err != nil { return nil, resp, err } + return configurations, resp, nil } // CreateNetworkConfiguration creates a hosted compute network configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#create-a-hosted-compute-network-configuration-for-an-organization // //meta:operation POST /orgs/{org}/settings/network-configurations func (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, org string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -143,17 +141,18 @@ func (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, o return nil, nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(ctx, req, &configuration) if err != nil { return nil, resp, err } + return configuration, resp, nil } // GetNetworkConfiguration gets a hosted compute network configuration configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-configuration-for-an-organization // //meta:operation GET /orgs/{org}/settings/network-configurations/{network_configuration_id} func (s *OrganizationsService) GetNetworkConfiguration(ctx context.Context, org, networkID string) (*NetworkConfiguration, *Response, error) { @@ -163,17 +162,18 @@ func (s *OrganizationsService) GetNetworkConfiguration(ctx context.Context, org, return nil, nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(ctx, req, &configuration) if err != nil { return nil, resp, err } + return configuration, resp, nil } // UpdateNetworkConfiguration updates a hosted compute network configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#update-a-hosted-compute-network-configuration-for-an-organization // //meta:operation PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id} func (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, org, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -187,17 +187,18 @@ func (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, o return nil, nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(ctx, req, &configuration) if err != nil { return nil, resp, err } + return configuration, resp, nil } // DeleteNetworkConfigurations deletes a hosted compute network configuration from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#delete-a-hosted-compute-network-configuration-from-an-organization // //meta:operation DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id} func (s *OrganizationsService) DeleteNetworkConfigurations(ctx context.Context, org, networkID string) (*Response, error) { @@ -207,17 +208,18 @@ func (s *OrganizationsService) DeleteNetworkConfigurations(ctx context.Context, return nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(ctx, req, &configuration) if err != nil { return resp, err } + return resp, nil } // GetNetworkConfigurationResource gets a hosted compute network settings resource configured for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-settings-resource-for-an-organization // //meta:operation GET /orgs/{org}/settings/network-settings/{network_settings_id} func (s *OrganizationsService) GetNetworkConfigurationResource(ctx context.Context, org, networkID string) (*NetworkSettingsResource, *Response, error) { @@ -227,10 +229,11 @@ func (s *OrganizationsService) GetNetworkConfigurationResource(ctx context.Conte return nil, nil, err } - resource := &NetworkSettingsResource{} - resp, err := s.client.Do(ctx, req, resource) + var resource *NetworkSettingsResource + resp, err := s.client.Do(ctx, req, &resource) if err != nil { return nil, resp, err } + return resource, resp, nil } diff --git a/vendor/github.com/google/go-github/v82/github/orgs_organization_properties.go b/vendor/github.com/google/go-github/v85/github/orgs_organization_properties.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/orgs_organization_properties.go rename to vendor/github.com/google/go-github/v85/github/orgs_organization_properties.go index 4e4c33c77..abf2a706a 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_organization_properties.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_organization_properties.go @@ -18,7 +18,7 @@ type OrganizationCustomPropertyValues struct { // GetOrganizationCustomPropertyValues returns all custom property names and their values for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs#get-all-custom-property-values-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs?apiVersion=2022-11-28#get-all-custom-property-values-for-an-organization // //meta:operation GET /organizations/{org}/org-properties/values func (s *OrganizationsService) GetOrganizationCustomPropertyValues(ctx context.Context, org string) ([]*CustomPropertyValue, *Response, error) { @@ -41,7 +41,7 @@ func (s *OrganizationsService) GetOrganizationCustomPropertyValues(ctx context.C // CreateOrUpdateOrganizationCustomPropertyValues creates or updates custom property values for an organization. // To remove a custom property value from an organization, set the property value to null. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs#create-or-update-custom-property-values-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-custom-property-values-for-an-organization // //meta:operation PATCH /organizations/{org}/org-properties/values func (s *OrganizationsService) CreateOrUpdateOrganizationCustomPropertyValues(ctx context.Context, org string, values OrganizationCustomPropertyValues) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_organization_roles.go b/vendor/github.com/google/go-github/v85/github/orgs_organization_roles.go similarity index 68% rename from vendor/github.com/google/go-github/v82/github/orgs_organization_roles.go rename to vendor/github.com/google/go-github/v85/github/orgs_organization_roles.go index 0954b92d4..212097c96 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_organization_roles.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_organization_roles.go @@ -12,12 +12,12 @@ import ( // OrganizationCustomRoles represents custom organization roles available in specified organization. type OrganizationCustomRoles struct { - TotalCount *int `json:"total_count,omitempty"` - CustomRepoRoles []*CustomOrgRoles `json:"roles,omitempty"` + TotalCount *int `json:"total_count,omitempty"` + CustomRepoRoles []*CustomOrgRole `json:"roles,omitempty"` } -// CustomOrgRoles represents custom organization role available in specified organization. -type CustomOrgRoles struct { +// CustomOrgRole represents custom organization role available in specified organization. +type CustomOrgRole struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -29,18 +29,32 @@ type CustomOrgRoles struct { BaseRole *string `json:"base_role,omitempty"` } -// CreateOrUpdateOrgRoleOptions represents options required to create or update a custom organization role. -type CreateOrUpdateOrgRoleOptions struct { - Name *string `json:"name,omitempty"` +// CreateCustomOrgRoleRequest represents body parameters required to create a custom organization role. +type CreateCustomOrgRoleRequest struct { + Name string `json:"name"` Description *string `json:"description,omitempty"` Permissions []string `json:"permissions"` - BaseRole *string `json:"base_role,omitempty"` + BaseRole *string `json:"base_role,omitempty"` // Can be one of: read, triage, write, maintain, admin +} + +// UpdateCustomOrgRoleRequest represents body parameters to update a custom organization role. +type UpdateCustomOrgRoleRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Permissions []string `json:"permissions,omitempty"` + BaseRole *string `json:"base_role,omitempty"` // Can be one of: none, read, triage, write, maintain, admin +} + +// OrganizationFineGrainedPermission represents a fine-grained permission that protects organization resources. +type OrganizationFineGrainedPermission struct { + Name string `json:"name"` + Description string `json:"description"` } // ListRoles lists the custom roles available in this organization. // In order to see custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#get-all-organization-roles-for-an-organization // //meta:operation GET /orgs/{org}/organization-roles func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*OrganizationCustomRoles, *Response, error) { @@ -51,8 +65,8 @@ func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*Orga return nil, nil, err } - customRepoRoles := new(OrganizationCustomRoles) - resp, err := s.client.Do(ctx, req, customRepoRoles) + var customRepoRoles *OrganizationCustomRoles + resp, err := s.client.Do(ctx, req, &customRepoRoles) if err != nil { return nil, resp, err } @@ -63,10 +77,10 @@ func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*Orga // GetOrgRole gets an organization role in this organization. // In order to get organization roles in an organization, the authenticated user must be an organization owner, or have access via an organization role. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#get-an-organization-role // //meta:operation GET /orgs/{org}/organization-roles/{role_id} -func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRoles, *Response, error) { +func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRole, *Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) req, err := s.client.NewRequest("GET", u, nil) @@ -74,8 +88,8 @@ func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleI return nil, nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return nil, resp, err } @@ -86,19 +100,19 @@ func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleI // CreateCustomOrgRole creates a custom role in this organization. // In order to create custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#create-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#create-a-custom-organization-role // //meta:operation POST /orgs/{org}/organization-roles -func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { +func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, request CreateCustomOrgRoleRequest) (*CustomOrgRole, *Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles", org) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest("POST", u, request) if err != nil { return nil, nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return nil, resp, err } @@ -109,19 +123,19 @@ func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org stri // UpdateCustomOrgRole updates a custom role in this organization. // In order to update custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#update-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#update-a-custom-organization-role // //meta:operation PATCH /orgs/{org}/organization-roles/{role_id} -func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { +func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, request UpdateCustomOrgRoleRequest) (*CustomOrgRole, *Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest("PATCH", u, request) if err != nil { return nil, nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return nil, resp, err } @@ -132,7 +146,7 @@ func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org stri // DeleteCustomOrgRole deletes an existing custom role in this organization. // In order to delete custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#delete-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#delete-a-custom-organization-role // //meta:operation DELETE /orgs/{org}/organization-roles/{role_id} func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org string, roleID int64) (*Response, error) { @@ -143,8 +157,8 @@ func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org stri return nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(ctx, req, &resultingRole) if err != nil { return resp, err } @@ -155,7 +169,7 @@ func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org stri // AssignOrgRoleToTeam assigns an existing organization role to a team in this organization. // In order to assign organization roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#assign-an-organization-role-to-a-team // //meta:operation PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} func (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { @@ -177,7 +191,7 @@ func (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, tea // RemoveOrgRoleFromTeam removes an existing organization role assignment from a team in this organization. // In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#remove-an-organization-role-from-a-team // //meta:operation DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} func (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { @@ -199,7 +213,7 @@ func (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, t // AssignOrgRoleToUser assigns an existing organization role to a user in this organization. // In order to assign organization roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#assign-an-organization-role-to-a-user // //meta:operation PUT /orgs/{org}/organization-roles/users/{username}/{role_id} func (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { @@ -221,7 +235,7 @@ func (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, use // RemoveOrgRoleFromUser removes an existing organization role assignment from a user in this organization. // In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#remove-an-organization-role-from-a-user // //meta:operation DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { @@ -243,7 +257,7 @@ func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, u // ListTeamsAssignedToOrgRole returns all teams assigned to a specific organization role. // In order to list teams assigned to an organization role, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#list-teams-that-are-assigned-to-an-organization-role // //meta:operation GET /orgs/{org}/organization-roles/{role_id}/teams func (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*Team, *Response, error) { @@ -270,7 +284,7 @@ func (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, o // ListUsersAssignedToOrgRole returns all users assigned to a specific organization role. // In order to list users assigned to an organization role, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#list-users-that-are-assigned-to-an-organization-role // //meta:operation GET /orgs/{org}/organization-roles/{role_id}/users func (s *OrganizationsService) ListUsersAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*User, *Response, error) { @@ -293,3 +307,31 @@ func (s *OrganizationsService) ListUsersAssignedToOrgRole(ctx context.Context, o return users, resp, nil } + +// ListFineGrainedPermissions lists the fine-grained permissions that can be used in custom organization roles for an organization. +// +// To use this endpoint, the authenticated user must be one of: +// - An administrator for the organization. +// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. +// +// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#list-organization-fine-grained-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/organization-fine-grained-permissions +func (s *OrganizationsService) ListFineGrainedPermissions(ctx context.Context, org string) ([]*OrganizationFineGrainedPermission, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-fine-grained-permissions", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var permissions []*OrganizationFineGrainedPermission + resp, err := s.client.Do(ctx, req, &permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} diff --git a/vendor/github.com/google/go-github/v82/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v85/github/orgs_outside_collaborators.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v85/github/orgs_outside_collaborators.go index 72f885fed..1b5ff2746 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_outside_collaborators.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_outside_collaborators.go @@ -27,7 +27,7 @@ type ListOutsideCollaboratorsOptions struct { // Warning: The API may change without advance notice during the preview period. // Preview features are not supported for production use. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators?apiVersion=2022-11-28#list-outside-collaborators-for-an-organization // //meta:operation GET /orgs/{org}/outside_collaborators func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) { @@ -54,7 +54,7 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // RemoveOutsideCollaborator removes a user from the list of outside collaborators; // consequently, removing them from all the organization's repositories. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators?apiVersion=2022-11-28#remove-outside-collaborator-from-an-organization // //meta:operation DELETE /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) { @@ -73,7 +73,7 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // Responses for converting a non-member or the last owner to an outside collaborator // are listed in GitHub API docs. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators?apiVersion=2022-11-28#convert-an-organization-member-to-outside-collaborator // //meta:operation PUT /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_packages.go b/vendor/github.com/google/go-github/v85/github/orgs_packages.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/orgs_packages.go rename to vendor/github.com/google/go-github/v85/github/orgs_packages.go index edd8e508f..87c3b012a 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_packages.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_packages.go @@ -13,7 +13,7 @@ import ( // ListPackages lists the packages for an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-packages-for-an-organization // //meta:operation GET /orgs/{org}/packages func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { @@ -41,7 +41,7 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-for-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) { @@ -64,7 +64,7 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-for-an-organization // //meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { @@ -81,7 +81,7 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-for-an-organization // //meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/restore func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { @@ -98,7 +98,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { @@ -126,7 +126,7 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-version-for-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { @@ -149,7 +149,7 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-package-version-for-an-organization // //meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { @@ -166,7 +166,7 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-package-version-for-an-organization // //meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v85/github/orgs_personal_access_tokens.go similarity index 58% rename from vendor/github.com/google/go-github/v82/github/orgs_personal_access_tokens.go rename to vendor/github.com/google/go-github/v85/github/orgs_personal_access_tokens.go index 8155ad402..32ad656de 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_personal_access_tokens.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_personal_access_tokens.go @@ -10,12 +10,13 @@ import ( "errors" "fmt" "net/url" + "strconv" "strings" ) // PersonalAccessToken represents the minimal representation of an organization programmatic access grant. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28 +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28 type PersonalAccessToken struct { // "Unique identifier of the fine-grained personal access token. // The `pat_id` used to get details about an approved fine-grained personal access token. @@ -83,13 +84,16 @@ type ListFineGrainedPATOptions struct { // This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. LastUsedAfter string `url:"last_used_after,omitempty"` + // TokenID filters results by the given fine-grained personal access token IDs. + TokenID []int64 `url:"-"` + ListOptions } // ListFineGrainedPersonalAccessTokens lists approved fine-grained personal access tokens owned by organization members that can access organization resources. // Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read). // -// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#list-fine-grained-personal-access-tokens-with-access-to-organization-resources // //meta:operation GET /orgs/{org}/personal-access-tokens func (s *OrganizationsService) ListFineGrainedPersonalAccessTokens(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*PersonalAccessToken, *Response, error) { @@ -115,6 +119,75 @@ func (s *OrganizationsService) ListFineGrainedPersonalAccessTokens(ctx context.C return pats, resp, nil } +// FineGrainedPersonalAccessTokenRequest represents the details of a request to access organization resources via a fine-grained personal access token. +type FineGrainedPersonalAccessTokenRequest struct { + // Unique identifier of the request for access via fine-grained personal access token. + ID int64 `json:"id"` + + // Reason is the reason for the request. + Reason string `json:"reason"` + + // Owner is the GitHub user associated with the token. + Owner User `json:"owner"` + + // RepositorySelection is the type of repository selection requested. + // Possible values are: "none", "all", "subset". + RepositorySelection string `json:"repository_selection"` + + // URL to the list of repositories the fine-grained personal access token can access. + // Only follow when `repository_selection` is `subset`. + RepositoriesURL string `json:"repositories_url"` + + // Permissions are the permissions requested, categorized by type. + Permissions PersonalAccessTokenPermissions `json:"permissions"` + + // Date and time when the request was created. + CreatedAt *Timestamp `json:"created_at"` + + // Whether the associated fine-grained personal access token has expired. + TokenExpired bool `json:"token_expired"` + + // Date and time when the associated fine-grained personal access token expires. + TokenExpiresAt *Timestamp `json:"token_expires_at"` + + // TokenID + TokenID int64 `json:"token_id"` + + // TokenName + TokenName string `json:"token_name"` + + // Date and time when the associated fine-grained personal access token was last used for authentication. + TokenLastUsedAt *Timestamp `json:"token_last_used_at"` +} + +// ListFineGrainedPersonalAccessTokenRequests lists requests to access organization resources via fine-grained personal access tokens. +// Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read). +// +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens +// +//meta:operation GET /orgs/{org}/personal-access-token-requests +func (s *OrganizationsService) ListFineGrainedPersonalAccessTokenRequests(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*FineGrainedPersonalAccessTokenRequest, *Response, error) { + u := fmt.Sprintf("orgs/%v/personal-access-token-requests", org) + // The `owner` parameter is a special case that uses the `owner[]=...` format and needs a custom function to format it correctly. + u, err := addListFineGrainedPATOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, opts) + if err != nil { + return nil, nil, err + } + + var pats []*FineGrainedPersonalAccessTokenRequest + resp, err := s.client.Do(ctx, req, &pats) + if err != nil { + return nil, resp, err + } + + return pats, resp, nil +} + // ReviewPersonalAccessTokenRequestOptions specifies the parameters to the ReviewPersonalAccessTokenRequest method. type ReviewPersonalAccessTokenRequestOptions struct { Action string `json:"action"` @@ -125,7 +198,7 @@ type ReviewPersonalAccessTokenRequestOptions struct { // Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. // `action` can be one of `approve` or `deny`. // -// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token // //meta:operation POST /orgs/{org}/personal-access-token-requests/{pat_request_id} func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { @@ -139,16 +212,16 @@ func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Cont return s.client.Do(ctx, req, nil) } -// addListFineGrainedPATOptions adds the owner parameter to the URL query string with the correct format if it is set. +// addListFineGrainedPATOptions adds the owner and token_id parameters to the URL query string with the correct format if they are set. // // GitHub API expects the owner parameter to be a list of strings in the `owner[]=...` format. -// For multiple owner values, the owner parameter is repeated in the query string. +// For multiple owner and token_id values, the owner and token_id parameters are repeated in the query string. // // Example: -// owner[]=user1&owner[]=user2 -// This will filter the results to only include fine-grained personal access tokens owned by `user1` and `user2`. +// owner[]=user1&owner[]=user2&token_id[]=123&token_id[]=456 +// This will filter the results to only include fine-grained personal access tokens owned by `user1` and `user2` and with token IDs `123` and `456`. // -// This function ensures the owner parameter is formatted correctly in the URL query string. +// This function ensures the owner and token_id parameters are formatted correctly in the URL query string. func addListFineGrainedPATOptions(s string, opts *ListFineGrainedPATOptions) (string, error) { u, err := addOptions(s, opts) if err != nil { @@ -172,6 +245,20 @@ func addListFineGrainedPATOptions(s string, opts *ListFineGrainedPATOptions) (st u += "?" + ownerQuery } } + if len(opts.TokenID) > 0 { + tokenIDVals := make([]string, len(opts.TokenID)) + for i, tokenID := range opts.TokenID { + tokenIDVals[i] = fmt.Sprintf("token_id[]=%v", url.QueryEscape(strconv.FormatInt(tokenID, 10))) + } + tokenIDQuery := strings.Join(tokenIDVals, "&") + + if strings.Contains(u, "?") { + u += "&" + tokenIDQuery + } else { + u += "?" + tokenIDQuery + } + return u, nil + } return u, nil } diff --git a/vendor/github.com/google/go-github/v82/github/orgs_properties.go b/vendor/github.com/google/go-github/v85/github/orgs_properties.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/orgs_properties.go rename to vendor/github.com/google/go-github/v85/github/orgs_properties.go index 8b9541bde..d2568e140 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_properties.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_properties.go @@ -156,7 +156,7 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { // GetAllCustomProperties gets all custom properties that are defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#get-all-custom-properties-for-an-organization // //meta:operation GET /orgs/{org}/properties/schema func (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org string) ([]*CustomProperty, *Response, error) { @@ -178,7 +178,7 @@ func (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org s // CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#create-or-update-custom-properties-for-an-organization // //meta:operation PATCH /orgs/{org}/properties/schema func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Context, org string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { @@ -206,7 +206,7 @@ func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Contex // GetCustomProperty gets a custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#get-a-custom-property-for-an-organization // //meta:operation GET /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name string) (*CustomProperty, *Response, error) { @@ -228,7 +228,7 @@ func (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name // CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#create-or-update-a-custom-property-for-an-organization // //meta:operation PUT /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, org, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { @@ -250,7 +250,7 @@ func (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, // RemoveCustomProperty removes a custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#remove-a-custom-property-for-an-organization // //meta:operation DELETE /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, customPropertyName string) (*Response, error) { @@ -266,7 +266,7 @@ func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, cu // ListCustomPropertyValues lists all custom property values for repositories in the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#list-custom-property-values-for-organization-repositories // //meta:operation GET /orgs/{org}/properties/values func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) ([]*RepoCustomPropertyValue, *Response, error) { @@ -292,7 +292,7 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org // CreateOrUpdateRepoCustomPropertyValues creates new or updates existing custom property values across multiple repositories for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#create-or-update-custom-property-values-for-organization-repositories // //meta:operation PATCH /orgs/{org}/properties/values func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomPropertyValue) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_rules.go b/vendor/github.com/google/go-github/v85/github/orgs_rules.go similarity index 83% rename from vendor/github.com/google/go-github/v82/github/orgs_rules.go rename to vendor/github.com/google/go-github/v85/github/orgs_rules.go index 26012091a..0c959a151 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_rules.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_rules.go @@ -12,7 +12,7 @@ import ( // GetAllRepositoryRulesets gets all the repository rulesets for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#get-all-organization-repository-rulesets // //meta:operation GET /orgs/{org}/rulesets func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string, opts *ListOptions) ([]*RepositoryRuleset, *Response, error) { @@ -39,7 +39,7 @@ func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org // CreateRepositoryRuleset creates a repository ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#create-an-organization-repository-ruleset // //meta:operation POST /orgs/{org}/rulesets func (s *OrganizationsService) CreateRepositoryRuleset(ctx context.Context, org string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { @@ -61,7 +61,7 @@ func (s *OrganizationsService) CreateRepositoryRuleset(ctx context.Context, org // GetRepositoryRuleset gets a repository ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#get-an-organization-repository-ruleset // //meta:operation GET /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) GetRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*RepositoryRuleset, *Response, error) { @@ -83,7 +83,7 @@ func (s *OrganizationsService) GetRepositoryRuleset(ctx context.Context, org str // UpdateRepositoryRuleset updates a repository ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#update-an-organization-repository-ruleset // //meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) UpdateRepositoryRuleset(ctx context.Context, org string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { @@ -105,7 +105,7 @@ func (s *OrganizationsService) UpdateRepositoryRuleset(ctx context.Context, org // DeleteRepositoryRuleset deletes a repository ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#delete-an-organization-repository-ruleset // //meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) DeleteRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_security_managers.go b/vendor/github.com/google/go-github/v85/github/orgs_security_managers.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/orgs_security_managers.go rename to vendor/github.com/google/go-github/v85/github/orgs_security_managers.go index b8562a2fd..2ed471ef9 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_security_managers.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_security_managers.go @@ -14,7 +14,7 @@ import ( // // Deprecated: Please use `client.Organizations.ListTeamsAssignedToOrgRole` instead. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers?apiVersion=2022-11-28#list-security-manager-teams // //meta:operation GET /orgs/{org}/security-managers func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) { @@ -38,7 +38,7 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // // Deprecated: Please use `client.Organizations.AssignOrgRoleToTeam` instead. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers?apiVersion=2022-11-28#add-a-security-manager-team // //meta:operation PUT /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { @@ -55,7 +55,7 @@ func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, // // Deprecated: Please use `client.Organizations.RemoveOrgRoleFromTeam` instead. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers?apiVersion=2022-11-28#remove-a-security-manager-team // //meta:operation DELETE /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v85/github/orgs_users_blocking.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v85/github/orgs_users_blocking.go index 60ee0f18b..871d62ff7 100644 --- a/vendor/github.com/google/go-github/v82/github/orgs_users_blocking.go +++ b/vendor/github.com/google/go-github/v85/github/orgs_users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the users blocked by an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#list-users-blocked-by-an-organization // //meta:operation GET /orgs/{org}/blocks func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) { @@ -40,7 +40,7 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // IsBlocked reports whether specified user is blocked from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#check-if-a-user-is-blocked-by-an-organization // //meta:operation GET /orgs/{org}/blocks/{username} func (s *OrganizationsService) IsBlocked(ctx context.Context, org, user string) (bool, *Response, error) { @@ -60,7 +60,7 @@ func (s *OrganizationsService) IsBlocked(ctx context.Context, org, user string) // BlockUser blocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#block-a-user-from-an-organization // //meta:operation PUT /orgs/{org}/blocks/{username} func (s *OrganizationsService) BlockUser(ctx context.Context, org, user string) (*Response, error) { @@ -78,7 +78,7 @@ func (s *OrganizationsService) BlockUser(ctx context.Context, org, user string) // UnblockUser unblocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#unblock-a-user-from-an-organization // //meta:operation DELETE /orgs/{org}/blocks/{username} func (s *OrganizationsService) UnblockUser(ctx context.Context, org, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/packages.go b/vendor/github.com/google/go-github/v85/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v82/github/packages.go rename to vendor/github.com/google/go-github/v85/github/packages.go diff --git a/vendor/github.com/google/go-github/v82/github/private_registries.go b/vendor/github.com/google/go-github/v85/github/private_registries.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/private_registries.go rename to vendor/github.com/google/go-github/v85/github/private_registries.go index ff8582c45..045dbd376 100644 --- a/vendor/github.com/google/go-github/v82/github/private_registries.go +++ b/vendor/github.com/google/go-github/v85/github/private_registries.go @@ -13,7 +13,7 @@ import ( // PrivateRegistriesService handles communication with the private registries // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/private-registries +// GitHub API docs: https://docs.github.com/rest/private-registries?apiVersion=2022-11-28 type PrivateRegistriesService service // PrivateRegistryType represents the type of private registry. @@ -129,7 +129,7 @@ type UpdateOrganizationPrivateRegistry struct { // ListOrganizationPrivateRegistries lists private registries for an organization. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2022-11-28#list-private-registries-for-an-organization // //meta:operation GET /orgs/{org}/private-registries func (s *PrivateRegistriesService) ListOrganizationPrivateRegistries(ctx context.Context, org string, opts *ListOptions) (*PrivateRegistries, *Response, error) { @@ -154,7 +154,7 @@ func (s *PrivateRegistriesService) ListOrganizationPrivateRegistries(ctx context // CreateOrganizationPrivateRegistry creates a private registry configuration with an encrypted value for an organization. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2022-11-28#create-a-private-registry-for-an-organization // //meta:operation POST /orgs/{org}/private-registries func (s *PrivateRegistriesService) CreateOrganizationPrivateRegistry(ctx context.Context, org string, privateRegistry CreateOrganizationPrivateRegistry) (*PrivateRegistry, *Response, error) { @@ -175,7 +175,7 @@ func (s *PrivateRegistriesService) CreateOrganizationPrivateRegistry(ctx context // GetOrganizationPrivateRegistriesPublicKey retrieves the public key for encrypting secrets for an organization's private registries. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2022-11-28#get-private-registries-public-key-for-an-organization // //meta:operation GET /orgs/{org}/private-registries/public-key func (s *PrivateRegistriesService) GetOrganizationPrivateRegistriesPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { @@ -197,7 +197,7 @@ func (s *PrivateRegistriesService) GetOrganizationPrivateRegistriesPublicKey(ctx // GetOrganizationPrivateRegistry gets a specific private registry for an organization. // The `name` parameter is the name of the private registry to retrieve. It is the same as PrivateRegistry.Name. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2022-11-28#get-a-private-registry-for-an-organization // //meta:operation GET /orgs/{org}/private-registries/{secret_name} func (s *PrivateRegistriesService) GetOrganizationPrivateRegistry(ctx context.Context, org, secretName string) (*PrivateRegistry, *Response, error) { @@ -220,7 +220,7 @@ func (s *PrivateRegistriesService) GetOrganizationPrivateRegistry(ctx context.Co // UpdateOrganizationPrivateRegistry updates a specific private registry for an organization. // The `name` parameter is the name of the private registry to update. It is the same as PrivateRegistry.Name. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2022-11-28#update-a-private-registry-for-an-organization // //meta:operation PATCH /orgs/{org}/private-registries/{secret_name} func (s *PrivateRegistriesService) UpdateOrganizationPrivateRegistry(ctx context.Context, org, secretName string, privateRegistry UpdateOrganizationPrivateRegistry) (*PrivateRegistry, *Response, error) { @@ -243,7 +243,7 @@ func (s *PrivateRegistriesService) UpdateOrganizationPrivateRegistry(ctx context // DeleteOrganizationPrivateRegistry deletes a specific private registry for an organization. // The `name` parameter is the name of the private registry to delete. It is the same as PrivateRegistry.Name. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2022-11-28#delete-a-private-registry-for-an-organization // //meta:operation DELETE /orgs/{org}/private-registries/{secret_name} func (s *PrivateRegistriesService) DeleteOrganizationPrivateRegistry(ctx context.Context, org, secretName string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/projects.go b/vendor/github.com/google/go-github/v85/github/projects.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/projects.go rename to vendor/github.com/google/go-github/v85/github/projects.go index d2c52f379..d23a3abb1 100644 --- a/vendor/github.com/google/go-github/v82/github/projects.go +++ b/vendor/github.com/google/go-github/v85/github/projects.go @@ -14,7 +14,7 @@ import ( // ProjectsService handles communication with the project V2 // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/projects/projects +// GitHub API docs: https://docs.github.com/rest/projects?apiVersion=2022-11-28 type ProjectsService service // ProjectV2ItemContentType represents the type of content in a ProjectV2Item. @@ -96,13 +96,13 @@ func (p ProjectV2) String() string { return Stringify(p) } // per page (max 100 per GitHub API docs). type ListProjectsPaginationOptions struct { // A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. - Before *string `url:"before,omitempty"` + Before string `url:"before,omitempty"` // A cursor, as given in the Link header. If specified, the query only searches for events after this cursor. - After *string `url:"after,omitempty"` + After string `url:"after,omitempty"` // For paginated result sets, the number of results to include per page. - PerPage *int `url:"per_page,omitempty"` + PerPage int `url:"per_page,omitempty"` } // ListProjectsOptions specifies optional parameters to list projects for user / organization. @@ -110,13 +110,13 @@ type ListProjectsOptions struct { ListProjectsPaginationOptions // Q is an optional query string to limit results to projects of the specified type. - Query *string `url:"q,omitempty"` + Query string `url:"q,omitempty"` } // ProjectV2TextContent represents text content in a project field option or iteration. // It includes both HTML and raw text representations. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2TextContent struct { HTML *string `json:"html,omitempty"` Raw *string `json:"raw,omitempty"` @@ -125,7 +125,7 @@ type ProjectV2TextContent struct { // ProjectV2FieldOption represents an option for a project field of type single_select or multi_select. // It defines the available choices that can be selected for dropdown-style fields. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2FieldOption struct { ID *string `json:"id,omitempty"` // The unique identifier for this option. Color *string `json:"color,omitempty"` // The color associated with this option (e.g., "blue", "red"). @@ -136,7 +136,7 @@ type ProjectV2FieldOption struct { // ProjectV2FieldIteration represents an iteration within a project field of type iteration. // It defines a specific time-bound period that can be associated with project items. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2FieldIteration struct { ID *string `json:"id,omitempty"` // The unique identifier for the iteration. Title *ProjectV2TextContent `json:"title,omitempty"` // The title of the iteration. @@ -147,7 +147,7 @@ type ProjectV2FieldIteration struct { // ProjectV2FieldConfiguration represents the configuration for a project field of type iteration. // It defines settings such as duration and start day for iterations within the project. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2FieldConfiguration struct { Duration *int `json:"duration,omitempty"` // The duration of the iteration field in seconds. StartDay *int `json:"start_day,omitempty"` // The start day for the iteration. @@ -238,7 +238,7 @@ func (p *ProjectV2Item) UnmarshalJSON(data []byte) error { // ProjectV2Field represents a field in a GitHub Projects V2 project. // Fields define the structure and data types for project items. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2Field struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -275,7 +275,7 @@ type ProjectV2ItemFieldValue struct { // ListOrganizationProjects lists Projects V2 for an organization. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-projects-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#list-projects-for-organization // //meta:operation GET /orgs/{org}/projectsV2 func (s *ProjectsService) ListOrganizationProjects(ctx context.Context, org string, opts *ListProjectsOptions) ([]*ProjectV2, *Response, error) { @@ -295,12 +295,13 @@ func (s *ProjectsService) ListOrganizationProjects(ctx context.Context, org stri if err != nil { return nil, resp, err } + return projects, resp, nil } // GetOrganizationProject gets a Projects V2 project for an organization by ID. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#get-project-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#get-project-for-organization // //meta:operation GET /orgs/{org}/projectsV2/{project_number} func (s *ProjectsService) GetOrganizationProject(ctx context.Context, org string, projectNumber int) (*ProjectV2, *Response, error) { @@ -310,17 +311,18 @@ func (s *ProjectsService) GetOrganizationProject(ctx context.Context, org string return nil, nil, err } - project := new(ProjectV2) - resp, err := s.client.Do(ctx, req, project) + var project *ProjectV2 + resp, err := s.client.Do(ctx, req, &project) if err != nil { return nil, resp, err } + return project, resp, nil } // ListUserProjects lists Projects V2 for a user. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-projects-for-user +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#list-projects-for-user // //meta:operation GET /users/{username}/projectsV2 func (s *ProjectsService) ListUserProjects(ctx context.Context, username string, opts *ListProjectsOptions) ([]*ProjectV2, *Response, error) { @@ -339,12 +341,13 @@ func (s *ProjectsService) ListUserProjects(ctx context.Context, username string, if err != nil { return nil, resp, err } + return projects, resp, nil } // GetUserProject gets a Projects V2 project for a user by ID. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#get-project-for-user +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#get-project-for-user // //meta:operation GET /users/{username}/projectsV2/{project_number} func (s *ProjectsService) GetUserProject(ctx context.Context, username string, projectNumber int) (*ProjectV2, *Response, error) { @@ -354,17 +357,18 @@ func (s *ProjectsService) GetUserProject(ctx context.Context, username string, p return nil, nil, err } - project := new(ProjectV2) - resp, err := s.client.Do(ctx, req, project) + var project *ProjectV2 + resp, err := s.client.Do(ctx, req, &project) if err != nil { return nil, resp, err } + return project, resp, nil } // ListOrganizationProjectFields lists Projects V2 for an organization. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#list-project-fields-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#list-project-fields-for-organization // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/fields func (s *ProjectsService) ListOrganizationProjectFields(ctx context.Context, org string, projectNumber int, opts *ListProjectsOptions) ([]*ProjectV2Field, *Response, error) { @@ -384,12 +388,13 @@ func (s *ProjectsService) ListOrganizationProjectFields(ctx context.Context, org if err != nil { return nil, resp, err } + return fields, resp, nil } // ListUserProjectFields lists Projects V2 for a user. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#list-project-fields-for-user +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#list-project-fields-for-user // //meta:operation GET /users/{username}/projectsV2/{project_number}/fields func (s *ProjectsService) ListUserProjectFields(ctx context.Context, user string, projectNumber int, opts *ListProjectsOptions) ([]*ProjectV2Field, *Response, error) { @@ -409,12 +414,13 @@ func (s *ProjectsService) ListUserProjectFields(ctx context.Context, user string if err != nil { return nil, resp, err } + return fields, resp, nil } // GetOrganizationProjectField gets a single project field from an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#get-project-field-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#get-project-field-for-organization // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id} func (s *ProjectsService) GetOrganizationProjectField(ctx context.Context, org string, projectNumber int, fieldID int64) (*ProjectV2Field, *Response, error) { @@ -424,17 +430,18 @@ func (s *ProjectsService) GetOrganizationProjectField(ctx context.Context, org s return nil, nil, err } - field := new(ProjectV2Field) - resp, err := s.client.Do(ctx, req, field) + var field *ProjectV2Field + resp, err := s.client.Do(ctx, req, &field) if err != nil { return nil, resp, err } + return field, resp, nil } // GetUserProjectField gets a single project field from a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#get-project-field-for-user +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#get-project-field-for-user // //meta:operation GET /users/{username}/projectsV2/{project_number}/fields/{field_id} func (s *ProjectsService) GetUserProjectField(ctx context.Context, user string, projectNumber int, fieldID int64) (*ProjectV2Field, *Response, error) { @@ -444,11 +451,12 @@ func (s *ProjectsService) GetUserProjectField(ctx context.Context, user string, return nil, nil, err } - field := new(ProjectV2Field) - resp, err := s.client.Do(ctx, req, field) + var field *ProjectV2Field + resp, err := s.client.Do(ctx, req, &field) if err != nil { return nil, resp, err } + return field, resp, nil } @@ -478,7 +486,7 @@ type AddProjectItemOptions struct { // UpdateProjectV2Field represents a field update for a project item. // -// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#update-project-item-for-organization type UpdateProjectV2Field struct { // ID is the field ID to update. ID int64 `json:"id"` @@ -505,7 +513,7 @@ type UpdateProjectItemOptions struct { // ListOrganizationProjectItems lists items for an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#list-items-for-an-organization-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#list-items-for-an-organization-owned-project // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/items func (s *ProjectsService) ListOrganizationProjectItems(ctx context.Context, org string, projectNumber int, opts *ListProjectItemsOptions) ([]*ProjectV2Item, *Response, error) { @@ -525,12 +533,13 @@ func (s *ProjectsService) ListOrganizationProjectItems(ctx context.Context, org if err != nil { return nil, resp, err } + return items, resp, nil } // AddOrganizationProjectItem adds an issue or pull request item to an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#add-item-to-organization-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#add-item-to-organization-owned-project // //meta:operation POST /orgs/{org}/projectsV2/{project_number}/items func (s *ProjectsService) AddOrganizationProjectItem(ctx context.Context, org string, projectNumber int, opts *AddProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -540,17 +549,18 @@ func (s *ProjectsService) AddOrganizationProjectItem(ctx context.Context, org st return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + var item *ProjectV2Item + resp, err := s.client.Do(ctx, req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // GetOrganizationProjectItem gets a single item from an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#get-an-item-for-an-organization-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#get-an-item-for-an-organization-owned-project // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) GetOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64, opts *GetProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -559,21 +569,24 @@ func (s *ProjectsService) GetOrganizationProjectItem(ctx context.Context, org st if err != nil { return nil, nil, err } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(ctx, req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // UpdateOrganizationProjectItem updates an item in an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#update-project-item-for-organization // //meta:operation PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) UpdateOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64, opts *UpdateProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -582,17 +595,19 @@ func (s *ProjectsService) UpdateOrganizationProjectItem(ctx context.Context, org if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(ctx, req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // DeleteOrganizationProjectItem deletes an item from an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#delete-project-item-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#delete-project-item-for-organization // //meta:operation DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) DeleteOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64) (*Response, error) { @@ -601,12 +616,13 @@ func (s *ProjectsService) DeleteOrganizationProjectItem(ctx context.Context, org if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } // ListUserProjectItems lists items for a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#list-items-for-a-user-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#list-items-for-a-user-owned-project // //meta:operation GET /users/{username}/projectsV2/{project_number}/items func (s *ProjectsService) ListUserProjectItems(ctx context.Context, username string, projectNumber int, opts *ListProjectItemsOptions) ([]*ProjectV2Item, *Response, error) { @@ -615,21 +631,24 @@ func (s *ProjectsService) ListUserProjectItems(ctx context.Context, username str if err != nil { return nil, nil, err } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } + var items []*ProjectV2Item resp, err := s.client.Do(ctx, req, &items) if err != nil { return nil, resp, err } + return items, resp, nil } // AddUserProjectItem adds an issue or pull request item to a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#add-item-to-user-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#add-item-to-user-owned-project // //meta:operation POST /users/{username}/projectsV2/{project_number}/items func (s *ProjectsService) AddUserProjectItem(ctx context.Context, username string, projectNumber int, opts *AddProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -638,17 +657,19 @@ func (s *ProjectsService) AddUserProjectItem(ctx context.Context, username strin if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(ctx, req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // GetUserProjectItem gets a single item from a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#get-an-item-for-a-user-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#get-an-item-for-a-user-owned-project // //meta:operation GET /users/{username}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) GetUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64, opts *GetProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -657,21 +678,24 @@ func (s *ProjectsService) GetUserProjectItem(ctx context.Context, username strin if err != nil { return nil, nil, err } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(ctx, req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // UpdateUserProjectItem updates an item in a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-user +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#update-project-item-for-user // //meta:operation PATCH /users/{username}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) UpdateUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64, opts *UpdateProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -680,17 +704,19 @@ func (s *ProjectsService) UpdateUserProjectItem(ctx context.Context, username st if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(ctx, req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // DeleteUserProjectItem deletes an item from a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#delete-project-item-for-user +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#delete-project-item-for-user // //meta:operation DELETE /users/{username}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) DeleteUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64) (*Response, error) { @@ -699,5 +725,6 @@ func (s *ProjectsService) DeleteUserProjectItem(ctx context.Context, username st if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v82/github/pulls.go b/vendor/github.com/google/go-github/v85/github/pulls.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/pulls.go rename to vendor/github.com/google/go-github/v85/github/pulls.go index aefd08a6d..fd055dec1 100644 --- a/vendor/github.com/google/go-github/v82/github/pulls.go +++ b/vendor/github.com/google/go-github/v85/github/pulls.go @@ -15,7 +15,7 @@ import ( // PullRequestsService handles communication with the pull request related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/pulls/ +// GitHub API docs: https://docs.github.com/rest/pulls?apiVersion=2022-11-28 type PullRequestsService service // PullRequestAutoMerge represents the "auto_merge" response for a PullRequest. @@ -59,7 +59,7 @@ type PullRequest struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Pull Requests REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/pulls/pulls#get-a-pull-request + // See: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` NodeID *string `json:"node_id,omitempty"` RequestedReviewers []*User `json:"requested_reviewers,omitempty"` @@ -151,7 +151,7 @@ type PullRequestListOptions struct { // List the pull requests for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests // //meta:operation GET /repos/{owner}/{repo}/pulls func (s *PullRequestsService) List(ctx context.Context, owner, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { @@ -182,7 +182,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner, repo string, opts // not present in the repository's default branch, the result will only include // open pull requests. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-pull-requests-associated-with-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { @@ -209,7 +209,7 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // Get a single pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Get(ctx context.Context, owner, repo string, number int) (*PullRequest, *Response, error) { @@ -219,8 +219,8 @@ func (s *PullRequestsService) Get(ctx context.Context, owner, repo string, numbe return nil, nil, err } - pull := new(PullRequest) - resp, err := s.client.Do(ctx, req, pull) + var pull *PullRequest + resp, err := s.client.Do(ctx, req, &pull) if err != nil { return nil, resp, err } @@ -230,7 +230,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner, repo string, numbe // GetRaw gets a single pull request in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) GetRaw(ctx context.Context, owner, repo string, number int, opts RawOptions) (string, *Response, error) { @@ -279,7 +279,7 @@ type NewPullRequest struct { // Create a new pull request on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls func (s *PullRequestsService) Create(ctx context.Context, owner, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { @@ -289,8 +289,8 @@ func (s *PullRequestsService) Create(ctx context.Context, owner, repo string, pu return nil, nil, err } - p := new(PullRequest) - resp, err := s.client.Do(ctx, req, p) + var p *PullRequest + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -320,7 +320,7 @@ type PullRequestBranchUpdateResponse struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#update-a-pull-request-branch // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) { @@ -333,8 +333,8 @@ func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo stri req.Header.Set("Accept", mediaTypeUpdatePullRequestBranchPreview) - p := new(PullRequestBranchUpdateResponse) - resp, err := s.client.Do(ctx, req, p) + var p *PullRequestBranchUpdateResponse + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -356,7 +356,7 @@ type pullRequestUpdate struct { // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify. // Base.Ref updates the base branch of the pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#update-a-pull-request // //meta:operation PATCH /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { @@ -384,8 +384,8 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, numb return nil, nil, err } - p := new(PullRequest) - resp, err := s.client.Do(ctx, req, p) + var p *PullRequest + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -395,7 +395,7 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, numb // ListCommits lists the commits in a pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#list-commits-on-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/commits func (s *PullRequestsService) ListCommits(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { @@ -421,7 +421,7 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner, repo strin // ListFiles lists the files in a pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests-files // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/files func (s *PullRequestsService) ListFiles(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { @@ -447,7 +447,7 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner, repo string, // IsMerged checks if a pull request has been merged. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#check-if-a-pull-request-has-been-merged // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) IsMerged(ctx context.Context, owner, repo string, number int) (bool, *Response, error) { @@ -491,13 +491,13 @@ type pullRequestMergeRequest struct { // Merge a pull request. // commitMessage is an extra detail to append to automatic commit message. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) Merge(ctx context.Context, owner, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/merge", owner, repo, number) - pullRequestBody := &pullRequestMergeRequest{} + var pullRequestBody pullRequestMergeRequest if commitMessage != "" { pullRequestBody.CommitMessage = &commitMessage } @@ -509,13 +509,13 @@ func (s *PullRequestsService) Merge(ctx context.Context, owner, repo string, num pullRequestBody.CommitMessage = &commitMessage } } - req, err := s.client.NewRequest("PUT", u, pullRequestBody) + req, err := s.client.NewRequest("PUT", u, &pullRequestBody) if err != nil { return nil, nil, err } - mergeResult := new(PullRequestMergeResult) - resp, err := s.client.Do(ctx, req, mergeResult) + var mergeResult *PullRequestMergeResult + resp, err := s.client.Do(ctx, req, &mergeResult) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/pulls_comments.go b/vendor/github.com/google/go-github/v85/github/pulls_comments.go similarity index 84% rename from vendor/github.com/google/go-github/v82/github/pulls_comments.go rename to vendor/github.com/google/go-github/v85/github/pulls_comments.go index 4d601730b..a6bf92035 100644 --- a/vendor/github.com/google/go-github/v82/github/pulls_comments.go +++ b/vendor/github.com/google/go-github/v85/github/pulls_comments.go @@ -40,12 +40,12 @@ type PullRequestComment struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Pull Request Comments REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request + // See: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#get-a-review-comment-for-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` - // Can be one of: LINE, FILE from https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request + // Can be one of: LINE, FILE from https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request SubjectType *string `json:"subject_type,omitempty"` } @@ -72,9 +72,9 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#list-review-comments-in-a-repository // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#list-review-comments-on-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/comments //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/comments @@ -109,7 +109,7 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri // GetComment fetches the specified pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#get-a-review-comment-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) { @@ -122,8 +122,8 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - comment := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, comment) + var comment *PullRequestComment + resp, err := s.client.Do(ctx, req, &comment) if err != nil { return nil, resp, err } @@ -133,7 +133,7 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string // CreateComment creates a new comment on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) { @@ -145,8 +145,8 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - c := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, c) + var c *PullRequestComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -156,7 +156,7 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { @@ -173,8 +173,8 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, return nil, nil, err } - c := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, c) + var c *PullRequestComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -185,7 +185,7 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, // EditComment updates a pull request comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#update-a-review-comment-for-a-pull-request // //meta:operation PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) { @@ -195,8 +195,8 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin return nil, nil, err } - c := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, c) + var c *PullRequestComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -206,7 +206,7 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin // DeleteComment deletes a pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#delete-a-review-comment-for-a-pull-request // //meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { @@ -215,5 +215,6 @@ func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo str if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v82/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v85/github/pulls_reviewers.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v85/github/pulls_reviewers.go index 9d1424741..836ab7b16 100644 --- a/vendor/github.com/google/go-github/v82/github/pulls_reviewers.go +++ b/vendor/github.com/google/go-github/v85/github/pulls_reviewers.go @@ -32,7 +32,7 @@ type removeReviewersRequest struct { // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests?apiVersion=2022-11-28#request-reviewers-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) { @@ -42,8 +42,8 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo return nil, nil, err } - r := new(PullRequest) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequest + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -53,23 +53,19 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests?apiVersion=2022-11-28#get-all-requested-reviewers-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers -func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opts *ListOptions) (*Reviewers, *Response, error) { +func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/requested_reviewers", owner, repo, number) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } - reviewers := new(Reviewers) - resp, err := s.client.Do(ctx, req, reviewers) + var reviewers *Reviewers + resp, err := s.client.Do(ctx, req, &reviewers) if err != nil { return nil, resp, err } @@ -79,7 +75,7 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // RemoveReviewers removes the review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests?apiVersion=2022-11-28#remove-requested-reviewers-from-a-pull-request // //meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/pulls_reviews.go b/vendor/github.com/google/go-github/v85/github/pulls_reviews.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v85/github/pulls_reviews.go index e8cf7a75b..effe2b8a5 100644 --- a/vendor/github.com/google/go-github/v82/github/pulls_reviews.go +++ b/vendor/github.com/google/go-github/v85/github/pulls_reviews.go @@ -29,7 +29,7 @@ type PullRequestReview struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Pull Request Reviews REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request + // See: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#get-a-review-for-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` } @@ -104,7 +104,7 @@ func (r PullRequestReviewDismissalRequest) String() string { // ListReviews lists all reviews on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#list-reviews-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) { @@ -130,7 +130,7 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#get-a-review-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { @@ -141,8 +141,8 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, return nil, nil, err } - review := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, review) + var review *PullRequestReview + resp, err := s.client.Do(ctx, req, &review) if err != nil { return nil, resp, err } @@ -152,7 +152,7 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#delete-a-pending-review-for-a-pull-request // //meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { @@ -163,8 +163,8 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re return nil, nil, err } - review := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, review) + var review *PullRequestReview + resp, err := s.client.Do(ctx, req, &review) if err != nil { return nil, resp, err } @@ -174,7 +174,7 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#list-comments-for-a-pull-request-review // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { @@ -234,7 +234,7 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // It is waaaaaay better. // ``` // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { @@ -254,8 +254,8 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri req.Header.Set("Accept", mediaTypeMultiLineCommentsPreview) } - r := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReview + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -265,7 +265,7 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri // UpdateReview updates the review summary on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#update-a-review-for-a-pull-request // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) { @@ -279,8 +279,8 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri return nil, nil, err } - review := &PullRequestReview{} - resp, err := s.client.Do(ctx, req, review) + var review *PullRequestReview + resp, err := s.client.Do(ctx, req, &review) if err != nil { return nil, resp, err } @@ -290,7 +290,7 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#submit-a-review-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { @@ -301,8 +301,8 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri return nil, nil, err } - r := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReview + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -312,7 +312,7 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#dismiss-a-review-for-a-pull-request // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { @@ -323,8 +323,8 @@ func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo str return nil, nil, err } - r := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReview + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/pulls_threads.go b/vendor/github.com/google/go-github/v85/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v82/github/pulls_threads.go rename to vendor/github.com/google/go-github/v85/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v82/github/rate_limit.go b/vendor/github.com/google/go-github/v85/github/rate_limit.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/rate_limit.go rename to vendor/github.com/google/go-github/v85/github/rate_limit.go index a26a23c93..8dab67d72 100644 --- a/vendor/github.com/google/go-github/v82/github/rate_limit.go +++ b/vendor/github.com/google/go-github/v85/github/rate_limit.go @@ -26,7 +26,7 @@ type Rate struct { // The rate limit resource that the request counted against. // For more information about the different resources, see REST API endpoints for rate limits. - // GitHub API docs: https://docs.github.com/en/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user + // GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit?apiVersion=2022-11-28#get-rate-limit-status-for-the-authenticated-user Resource string `json:"resource,omitempty"` } @@ -40,20 +40,20 @@ type RateLimits struct { // requests are limited to 60 per hour. Authenticated requests are // limited to 5,000 per hour. // - // GitHub API docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting + // GitHub API docs: https://docs.github.com/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting Core *Rate `json:"core"` // The rate limit for search API requests. Unauthenticated requests // are limited to 10 requests per minutes. Authenticated requests are // limited to 30 per minute. // - // GitHub API docs: https://docs.github.com/en/rest/search#rate-limit + // GitHub API docs: https://docs.github.com/rest/search?apiVersion=2022-11-28#rate-limit Search *Rate `json:"search"` // GitHub API docs: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit GraphQL *Rate `json:"graphql"` - // GitHub API dos: https://docs.github.com/en/rest/rate-limit + // GitHub API docs: https://docs.github.com/rest/rate-limit?apiVersion=2022-11-28 IntegrationManifest *Rate `json:"integration_manifest"` SourceImport *Rate `json:"source_import"` @@ -72,7 +72,7 @@ func (r RateLimits) String() string { // Get returns the rate limits for the current client. // -// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit?apiVersion=2022-11-28#get-rate-limit-status-for-the-authenticated-user // //meta:operation GET /rate_limit func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/reactions.go b/vendor/github.com/google/go-github/v85/github/reactions.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/reactions.go rename to vendor/github.com/google/go-github/v85/github/reactions.go index f8b4023c2..a3600fcff 100644 --- a/vendor/github.com/google/go-github/v82/github/reactions.go +++ b/vendor/github.com/google/go-github/v85/github/reactions.go @@ -13,7 +13,7 @@ import ( // ReactionsService provides access to the reactions-related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/reactions +// GitHub API docs: https://docs.github.com/rest/reactions?apiVersion=2022-11-28 type ReactionsService service // Reaction represents a GitHub reaction. @@ -59,7 +59,7 @@ type ListReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-commit-comment // //meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -90,13 +90,13 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-commit-comment // //meta:operation POST /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: Ptr(content)} + body := &Reaction{Content: &content} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -104,8 +104,8 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -115,7 +115,7 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-commit-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { @@ -126,7 +126,7 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-commit-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { @@ -137,7 +137,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -168,13 +168,13 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - body := &Reaction{Content: Ptr(content)} + body := &Reaction{Content: &content} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -182,8 +182,8 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -193,7 +193,7 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { @@ -204,7 +204,7 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { @@ -215,7 +215,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -246,13 +246,13 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-an-issue-comment // //meta:operation POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: Ptr(content)} + body := &Reaction{Content: &content} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -260,8 +260,8 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -271,7 +271,7 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { @@ -282,7 +282,7 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { @@ -293,7 +293,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-pull-request-review-comment // //meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -324,13 +324,13 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-pull-request-review-comment // //meta:operation POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: Ptr(content)} + body := &Reaction{Content: &content} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -338,8 +338,8 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -349,7 +349,7 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-pull-request-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { @@ -360,7 +360,7 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-pull-request-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { @@ -406,7 +406,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - body := &Reaction{Content: Ptr(content)} + body := &Reaction{Content: &content} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -414,8 +414,8 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -481,7 +481,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - body := &Reaction{Content: Ptr(content)} + body := &Reaction{Content: &content} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -489,8 +489,8 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -536,13 +536,13 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-release // //meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/reactions func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) - body := &Reaction{Content: Ptr(content)} + body := &Reaction{Content: &content} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -550,8 +550,8 @@ func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, rep req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(ctx, req, &m) if err != nil { return nil, resp, err } @@ -561,7 +561,7 @@ func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, rep // ListReleaseReactions lists the reactions for a release. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-release // //meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/reactions func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo string, releaseID int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -589,7 +589,7 @@ func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo // DeleteReleaseReaction deletes the reaction for a release. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction // //meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, repo string, releaseID, reactionID int64) (*Response, error) { @@ -600,7 +600,7 @@ func (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, rep // DeleteReleaseReactionByID deletes the reaction for a release by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction // //meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteReleaseReactionByID(ctx context.Context, repoID, releaseID, reactionID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos.go b/vendor/github.com/google/go-github/v85/github/repos.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/repos.go rename to vendor/github.com/google/go-github/v85/github/repos.go index d2ded4994..31edd8eaa 100644 --- a/vendor/github.com/google/go-github/v82/github/repos.go +++ b/vendor/github.com/google/go-github/v85/github/repos.go @@ -22,7 +22,7 @@ var ErrBranchNotProtected = errors.New("branch is not protected") // RepositoriesService handles communication with the repository related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/repos/ +// GitHub API docs: https://docs.github.com/rest/repos?apiVersion=2022-11-28 type RepositoriesService service // Repository represents a GitHub repository. @@ -142,7 +142,7 @@ type Repository struct { TeamsURL *string `json:"teams_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search?apiVersion=2022-11-28#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Visibility is only used for Create and Edit endpoints. The visibility field @@ -151,7 +151,7 @@ type Repository struct { Visibility *string `json:"visibility,omitempty"` // RoleName is only returned by the API 'check team permissions for a repository'. - // See: teams.go (IsTeamRepoByID) https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository + // See: teams.go (IsTeamRepoByID) https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository RoleName *string `json:"role_name,omitempty"` } @@ -200,6 +200,7 @@ type SecurityAndAnalysis struct { SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` SecretScanningValidityChecks *SecretScanningValidityChecks `json:"secret_scanning_validity_checks,omitempty"` + CodeSecurity *CodeSecurity `json:"code_security,omitempty"` } // RepositoryPermissions represents the permissions a user has for a repository. @@ -266,14 +267,25 @@ type SecretScanningValidityChecks struct { Status *string `json:"status,omitempty"` } +// CodeSecurity represents the state of code security on a repository. +// +// GitHub API docs: https://docs.github.com/en/code-security/getting-started/github-security-features#available-with-github-code-security +type CodeSecurity struct { + Status *string `json:"status,omitempty"` +} + +func (c CodeSecurity) String() string { + return Stringify(c) +} + // List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser // depending on whether user is empty. // // Deprecated: Use RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser instead. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-a-user // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user // //meta:operation GET /user/repos //meta:operation GET /users/{username}/repos @@ -322,7 +334,7 @@ type RepositoryListByUserOptions struct { // ListByUser lists public repositories for the specified user. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-a-user // //meta:operation GET /users/{username}/repos func (s *RepositoriesService) ListByUser(ctx context.Context, user string, opts *RepositoryListByUserOptions) ([]*Repository, *Response, error) { @@ -385,7 +397,7 @@ type RepositoryListByAuthenticatedUserOptions struct { // ListByAuthenticatedUser lists repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user // //meta:operation GET /user/repos func (s *RepositoriesService) ListByAuthenticatedUser(ctx context.Context, opts *RepositoryListByAuthenticatedUserOptions) ([]*Repository, *Response, error) { @@ -429,7 +441,7 @@ type RepositoryListByOrgOptions struct { // ListByOrg lists the repositories for an organization. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-organization-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories // //meta:operation GET /orgs/{org}/repos func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { @@ -465,7 +477,7 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-public-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-public-repositories // //meta:operation GET /repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { @@ -540,9 +552,9 @@ type createRepoRequest struct { // changes propagate throughout its servers. You may set up a loop with // exponential back-off to verify repository's creation. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-an-organization-repository // //meta:operation POST /orgs/{org}/repos //meta:operation POST /user/repos @@ -595,8 +607,8 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo acceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -617,7 +629,7 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-using-a-template // //meta:operation POST /repos/{template_owner}/{template_repo}/generate func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { @@ -629,8 +641,8 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw } req.Header.Set("Accept", mediaTypeRepositoryTemplatePreview) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -640,7 +652,7 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#get-a-repository // //meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { @@ -650,7 +662,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep return nil, nil, err } - // https://docs.github.com/rest/licenses/#get-a-repositorys-license + // https://docs.github.com/rest/licenses?apiVersion=2022-11-28#get-a-repositorys-license acceptHeaders := []string{ mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, @@ -659,8 +671,8 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(ctx, req, &repository) if err != nil { return nil, resp, err } @@ -669,10 +681,10 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // GetCodeOfConduct gets the contents of a repository's code of conduct. -// Note that https://docs.github.com/rest/codes-of-conduct#about-the-codes-of-conduct-api +// Note that https://docs.github.com/rest/codes-of-conduct?apiVersion=2022-11-28#about-the-codes-of-conduct-api // says to use the GET /repos/{owner}/{repo} endpoint. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#get-a-repository // //meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { @@ -684,8 +696,8 @@ func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypeCodesOfConductPreview) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -705,8 +717,8 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor return nil, nil, err } - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(ctx, req, &repository) if err != nil { return nil, resp, err } @@ -716,7 +728,7 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#update-a-repository // //meta:operation PATCH /repos/{owner}/{repo} func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { @@ -728,8 +740,8 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo acceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -739,7 +751,7 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo // Delete a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#delete-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#delete-a-repository // //meta:operation DELETE /repos/{owner}/{repo} func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) { @@ -788,7 +800,7 @@ type ListContributorsOptions struct { // GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-vulnerability-alerts-are-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { @@ -808,7 +820,7 @@ func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, // EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-vulnerability-alerts // //meta:operation PUT /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { @@ -826,7 +838,7 @@ func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, own // DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-vulnerability-alerts // //meta:operation DELETE /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { @@ -844,7 +856,7 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-dependabot-security-updates-are-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { @@ -855,8 +867,8 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own return nil, nil, err } - p := new(AutomatedSecurityFixes) - resp, err := s.client.Do(ctx, req, p) + var p *AutomatedSecurityFixes + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -865,7 +877,7 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-dependabot-security-updates // //meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { @@ -881,7 +893,7 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-dependabot-security-updates // //meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { @@ -897,7 +909,7 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, // ListContributors lists contributors for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-contributors // //meta:operation GET /repos/{owner}/{repo}/contributors func (s *RepositoriesService) ListContributors(ctx context.Context, owner, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { @@ -930,7 +942,7 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner, repos // "Python": 7769 // } // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-languages // //meta:operation GET /repos/{owner}/{repo}/languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner, repo string) (map[string]int, *Response, error) { @@ -951,7 +963,7 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner, repo str // ListTeams lists the teams for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-teams // //meta:operation GET /repos/{owner}/{repo}/teams func (s *RepositoriesService) ListTeams(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Team, *Response, error) { @@ -985,7 +997,7 @@ type RepositoryTag struct { // ListTags lists tags for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-tags // //meta:operation GET /repos/{owner}/{repo}/tags func (s *RepositoriesService) ListTags(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { @@ -1419,7 +1431,7 @@ type AutomatedSecurityFixes struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#list-branches // //meta:operation GET /repos/{owner}/{repo}/branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { @@ -1447,7 +1459,7 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner, repo stri // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branches#get-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#get-a-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch} func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, maxRedirects int) (*Branch, *Response, error) { @@ -1463,8 +1475,8 @@ func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } - b := new(Branch) - err = json.NewDecoder(resp.Body).Decode(b) + var b *Branch + err = json.NewDecoder(resp.Body).Decode(&b) return b, newResponse(resp), err } @@ -1480,7 +1492,7 @@ type renameBranchRequest struct { // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branches#rename-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#rename-a-branch // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/rename func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { @@ -1491,8 +1503,8 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra return nil, nil, err } - b := new(Branch) - resp, err := s.client.Do(ctx, req, b) + var b *Branch + resp, err := s.client.Do(ctx, req, &b) if err != nil { return nil, resp, err } @@ -1504,7 +1516,7 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-branch-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { @@ -1516,8 +1528,8 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - p := new(Protection) - resp, err := s.client.Do(ctx, req, p) + var p *Protection + resp, err := s.client.Do(ctx, req, &p) if err != nil { if isBranchNotProtected(err) { err = ErrBranchNotProtected @@ -1532,7 +1544,7 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-status-checks-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { @@ -1542,8 +1554,8 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner return nil, nil, err } - p := new(RequiredStatusChecks) - resp, err := s.client.Do(ctx, req, p) + var p *RequiredStatusChecks + resp, err := s.client.Do(ctx, req, &p) if err != nil { if isBranchNotProtected(err) { err = ErrBranchNotProtected @@ -1558,7 +1570,7 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-all-status-check-contexts // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { @@ -1583,7 +1595,7 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-branch-protection // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { @@ -1595,8 +1607,8 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - p := new(Protection) - resp, err := s.client.Do(ctx, req, p) + var p *Protection + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -1608,7 +1620,7 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-branch-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { @@ -1625,7 +1637,7 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-commit-signature-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { @@ -1637,8 +1649,8 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, req.Header.Set("Accept", mediaTypeSignaturePreview) - p := new(SignaturesProtectedBranch) - resp, err := s.client.Do(ctx, req, p) + var p *SignaturesProtectedBranch + resp, err := s.client.Do(ctx, req, &p) if err != nil { if isBranchNotProtected(err) { err = ErrBranchNotProtected @@ -1654,7 +1666,7 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#create-commit-signature-protection // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { @@ -1666,8 +1678,8 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con req.Header.Set("Accept", mediaTypeSignaturePreview) - r := new(SignaturesProtectedBranch) - resp, err := s.client.Do(ctx, req, r) + var r *SignaturesProtectedBranch + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -1679,7 +1691,7 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-commit-signature-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { @@ -1698,7 +1710,7 @@ func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Co // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-status-check-protection // //meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { @@ -1708,8 +1720,8 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow return nil, nil, err } - sc := new(RequiredStatusChecks) - resp, err := s.client.Do(ctx, req, sc) + var sc *RequiredStatusChecks + resp, err := s.client.Do(ctx, req, &sc) if err != nil { return nil, resp, err } @@ -1721,7 +1733,7 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-status-check-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { @@ -1736,7 +1748,7 @@ func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, ow // License gets the contents of a repository's license if one is detected. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository +// GitHub API docs: https://docs.github.com/rest/licenses/licenses?apiVersion=2022-11-28#get-the-license-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/license func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { @@ -1746,8 +1758,8 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( return nil, nil, err } - r := &RepositoryLicense{} - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryLicense + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -1759,7 +1771,7 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-pull-request-review-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { @@ -1771,8 +1783,8 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - r := new(PullRequestReviewsEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReviewsEnforcement + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -1785,7 +1797,7 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-pull-request-review-protection // //meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { @@ -1797,8 +1809,8 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - r := new(PullRequestReviewsEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReviewsEnforcement + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -1811,7 +1823,7 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-pull-request-review-protection // //meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { @@ -1828,8 +1840,8 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - r := new(PullRequestReviewsEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReviewsEnforcement + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -1841,7 +1853,7 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-pull-request-review-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { @@ -1858,7 +1870,7 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-admin-branch-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { @@ -1868,8 +1880,8 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re return nil, nil, err } - r := new(AdminEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *AdminEnforcement + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -1882,7 +1894,7 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-admin-branch-protection // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { @@ -1892,8 +1904,8 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re return nil, nil, err } - r := new(AdminEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *AdminEnforcement + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -1905,7 +1917,7 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-admin-branch-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { @@ -1925,11 +1937,16 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#get-all-repository-topics // //meta:operation GET /repos/{owner}/{repo}/topics -func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) ([]string, *Response, error) { +func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string, opts *ListOptions) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1937,8 +1954,8 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str req.Header.Set("Accept", mediaTypeTopicsPreview) - topics := new(repositoryTopics) - resp, err := s.client.Do(ctx, req, topics) + var topics *repositoryTopics + resp, err := s.client.Do(ctx, req, &topics) if err != nil { return nil, resp, err } @@ -1948,7 +1965,7 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str // ReplaceAllTopics replaces all repository topics. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#replace-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#replace-all-repository-topics // //meta:operation PUT /repos/{owner}/{repo}/topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { @@ -1982,7 +1999,7 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // // Deprecated: Please use ListAppRestrictions instead. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-apps-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { @@ -2006,7 +2023,7 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // // Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-apps-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { @@ -2021,7 +2038,7 @@ func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-app-access-restrictions // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { @@ -2047,7 +2064,7 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#add-app-access-restrictions // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { @@ -2073,7 +2090,7 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-app-access-restrictions // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { @@ -2097,7 +2114,7 @@ func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-teams-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { @@ -2124,7 +2141,7 @@ func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, r // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-team-access-restrictions // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { @@ -2150,7 +2167,7 @@ func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#add-team-access-restrictions // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { @@ -2176,7 +2193,7 @@ func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-team-access-restrictions // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { @@ -2200,7 +2217,7 @@ func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-users-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { @@ -2227,7 +2244,7 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-user-access-restrictions // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { @@ -2253,7 +2270,7 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#add-user-access-restrictions // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { @@ -2279,7 +2296,7 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-user-access-restrictions // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { @@ -2313,7 +2330,7 @@ type TransferRequest struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#transfer-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#transfer-a-repository // //meta:operation POST /repos/{owner}/{repo}/transfer func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) { @@ -2324,8 +2341,8 @@ func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, return nil, nil, err } - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -2344,7 +2361,7 @@ type DispatchRequestOptions struct { // Dispatch triggers a repository_dispatch event in a GitHub Actions workflow. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event // //meta:operation POST /repos/{owner}/{repo}/dispatches func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) { @@ -2355,8 +2372,8 @@ func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, return nil, nil, err } - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -2374,7 +2391,7 @@ func isBranchNotProtected(err error) bool { // EnablePrivateReporting enables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-private-vulnerability-reporting-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { @@ -2396,7 +2413,7 @@ func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, // DisablePrivateReporting disables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-private-vulnerability-reporting-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { @@ -2423,7 +2440,7 @@ type checkPrivateReporting struct { // IsPrivateReportingEnabled checks if private vulnerability reporting is enabled // for the repository and returns a boolean indicating the status. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-private-vulnerability-reporting-is-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) IsPrivateReportingEnabled(ctx context.Context, owner, repo string) (bool, *Response, error) { @@ -2434,8 +2451,8 @@ func (s *RepositoriesService) IsPrivateReportingEnabled(ctx context.Context, own return false, nil, err } - privateReporting := new(checkPrivateReporting) - resp, err := s.client.Do(ctx, req, privateReporting) + var privateReporting checkPrivateReporting + resp, err := s.client.Do(ctx, req, &privateReporting) return privateReporting.Enabled, resp, err } @@ -2511,7 +2528,7 @@ type RepositoryActivity struct { // ListRepositoryActivities lists the activities for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-activities +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-activities // //meta:operation GET /repos/{owner}/{repo}/activity func (s *RepositoriesService) ListRepositoryActivities(ctx context.Context, owner, repo string, opts *ListRepositoryActivityOptions) ([]*RepositoryActivity, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_actions_access.go b/vendor/github.com/google/go-github/v85/github/repos_actions_access.go similarity index 85% rename from vendor/github.com/google/go-github/v82/github/repos_actions_access.go rename to vendor/github.com/google/go-github/v85/github/repos_actions_access.go index 2da1f01cc..6c3c5dd5f 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_actions_access.go +++ b/vendor/github.com/google/go-github/v85/github/repos_actions_access.go @@ -12,7 +12,7 @@ import ( // RepositoryActionsAccessLevel represents the repository actions access level. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-the-level-of-access-for-workflows-outside-of-the-repository type RepositoryActionsAccessLevel struct { // AccessLevel specifies the level of access that workflows outside of the repository have // to actions and reusable workflows within the repository. @@ -23,7 +23,7 @@ type RepositoryActionsAccessLevel struct { // GetActionsAccessLevel gets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-the-level-of-access-for-workflows-outside-of-the-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) { @@ -33,8 +33,8 @@ func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, return nil, nil, err } - raal := new(RepositoryActionsAccessLevel) - resp, err := s.client.Do(ctx, req, raal) + var raal *RepositoryActionsAccessLevel + resp, err := s.client.Do(ctx, req, &raal) if err != nil { return nil, resp, err } @@ -45,7 +45,7 @@ func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, // EditActionsAccessLevel sets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-the-level-of-access-for-workflows-outside-of-the-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v85/github/repos_actions_allowed.go similarity index 81% rename from vendor/github.com/google/go-github/v82/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v85/github/repos_actions_allowed.go index e9ebff1d3..2024f656f 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_actions_allowed.go +++ b/vendor/github.com/google/go-github/v85/github/repos_actions_allowed.go @@ -12,7 +12,7 @@ import ( // GetActionsAllowed gets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) { @@ -22,8 +22,8 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s return nil, nil, err } - actionsAllowed := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, actionsAllowed) + var actionsAllowed *ActionsAllowed + resp, err := s.client.Do(ctx, req, &actionsAllowed) if err != nil { return nil, resp, err } @@ -33,7 +33,7 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s // EditActionsAllowed sets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { @@ -43,8 +43,8 @@ func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo return nil, nil, err } - p := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsAllowed + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v85/github/repos_actions_permissions.go similarity index 84% rename from vendor/github.com/google/go-github/v82/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v85/github/repos_actions_permissions.go index 7e56c3f39..88e95ba64 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_actions_permissions.go +++ b/vendor/github.com/google/go-github/v85/github/repos_actions_permissions.go @@ -12,7 +12,7 @@ import ( // ActionsPermissionsRepository represents a policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type ActionsPermissionsRepository struct { Enabled *bool `json:"enabled,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -26,7 +26,7 @@ func (a ActionsPermissionsRepository) String() string { // DefaultWorkflowPermissionRepository represents the default permissions for GitHub Actions workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type DefaultWorkflowPermissionRepository struct { DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` @@ -34,7 +34,7 @@ type DefaultWorkflowPermissionRepository struct { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { @@ -45,8 +45,8 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, return nil, nil, err } - permissions := new(ActionsPermissionsRepository) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissionsRepository + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -56,7 +56,7 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, // UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) UpdateActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) { @@ -66,8 +66,8 @@ func (s *RepositoriesService) UpdateActionsPermissions(ctx context.Context, owne return nil, nil, err } - permissions := new(ActionsPermissionsRepository) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissionsRepository + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -77,7 +77,7 @@ func (s *RepositoriesService) UpdateActionsPermissions(ctx context.Context, owne // GetDefaultWorkflowPermissions gets the GitHub Actions default workflow permissions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/workflow func (s *RepositoriesService) GetDefaultWorkflowPermissions(ctx context.Context, owner, repo string) (*DefaultWorkflowPermissionRepository, *Response, error) { @@ -88,8 +88,8 @@ func (s *RepositoriesService) GetDefaultWorkflowPermissions(ctx context.Context, return nil, nil, err } - permissions := new(DefaultWorkflowPermissionRepository) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *DefaultWorkflowPermissionRepository + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -99,7 +99,7 @@ func (s *RepositoriesService) GetDefaultWorkflowPermissions(ctx context.Context, // UpdateDefaultWorkflowPermissions sets the GitHub Actions default workflow permissions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/workflow func (s *RepositoriesService) UpdateDefaultWorkflowPermissions(ctx context.Context, owner, repo string, permissions DefaultWorkflowPermissionRepository) (*DefaultWorkflowPermissionRepository, *Response, error) { @@ -109,8 +109,8 @@ func (s *RepositoriesService) UpdateDefaultWorkflowPermissions(ctx context.Conte return nil, nil, err } - p := new(DefaultWorkflowPermissionRepository) - resp, err := s.client.Do(ctx, req, p) + var p *DefaultWorkflowPermissionRepository + resp, err := s.client.Do(ctx, req, &p) if err != nil { return nil, resp, err } @@ -120,7 +120,7 @@ func (s *RepositoriesService) UpdateDefaultWorkflowPermissions(ctx context.Conte // GetArtifactAndLogRetentionPeriod gets the artifact and log retention period for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention func (s *RepositoriesService) GetArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string) (*ArtifactPeriod, *Response, error) { @@ -131,8 +131,8 @@ func (s *RepositoriesService) GetArtifactAndLogRetentionPeriod(ctx context.Conte return nil, nil, err } - arp := new(ArtifactPeriod) - resp, err := s.client.Do(ctx, req, arp) + var arp *ArtifactPeriod + resp, err := s.client.Do(ctx, req, &arp) if err != nil { return nil, resp, err } @@ -142,7 +142,7 @@ func (s *RepositoriesService) GetArtifactAndLogRetentionPeriod(ctx context.Conte // UpdateArtifactAndLogRetentionPeriod sets the artifact and log retention period for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention func (s *RepositoriesService) UpdateArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string, period ArtifactPeriodOpt) (*Response, error) { @@ -157,7 +157,7 @@ func (s *RepositoriesService) UpdateArtifactAndLogRetentionPeriod(ctx context.Co // GetPrivateRepoForkPRWorkflowSettings gets the settings for whether workflows from fork pull requests can run on a private repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos func (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string) (*WorkflowsPermissions, *Response, error) { @@ -168,8 +168,8 @@ func (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.C return nil, nil, err } - permissions := new(WorkflowsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *WorkflowsPermissions + resp, err := s.client.Do(ctx, req, &permissions) if err != nil { return nil, resp, err } @@ -179,7 +179,7 @@ func (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.C // UpdatePrivateRepoForkPRWorkflowSettings sets the settings for whether workflows from fork pull requests can run on a private repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos func (s *RepositoriesService) UpdatePrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string, permissions *WorkflowsPermissionsOpt) (*Response, error) { @@ -194,7 +194,7 @@ func (s *RepositoriesService) UpdatePrivateRepoForkPRWorkflowSettings(ctx contex // GetForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string) (*ContributorApprovalPermissions, *Response, error) { @@ -205,8 +205,8 @@ func (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Con return nil, nil, err } - policy := new(ContributorApprovalPermissions) - resp, err := s.client.Do(ctx, req, policy) + var policy *ContributorApprovalPermissions + resp, err := s.client.Do(ctx, req, &policy) if err != nil { return nil, resp, err } @@ -216,7 +216,7 @@ func (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Con // UpdateForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) UpdateForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string, policy ContributorApprovalPermissions) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_attestations.go b/vendor/github.com/google/go-github/v85/github/repos_attestations.go similarity index 96% rename from vendor/github.com/google/go-github/v82/github/repos_attestations.go rename to vendor/github.com/google/go-github/v85/github/repos_attestations.go index 31690a2d8..b827a0180 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_attestations.go +++ b/vendor/github.com/google/go-github/v85/github/repos_attestations.go @@ -13,7 +13,7 @@ import ( // ListAttestations returns a collection of artifact attestations // with a given subject digest that are associated with a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/attestations#list-attestations +// GitHub API docs: https://docs.github.com/rest/repos/attestations?apiVersion=2022-11-28#list-attestations // //meta:operation GET /repos/{owner}/{repo}/attestations/{subject_digest} func (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_autolinks.go b/vendor/github.com/google/go-github/v85/github/repos_autolinks.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v85/github/repos_autolinks.go index 5bf2cede3..3076f8cdd 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_autolinks.go +++ b/vendor/github.com/google/go-github/v85/github/repos_autolinks.go @@ -28,15 +28,11 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#get-all-autolinks-of-a-repository // //meta:operation GET /repos/{owner}/{repo}/autolinks -func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { +func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string) ([]*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -55,7 +51,7 @@ func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo str // AddAutolink creates an autolink reference for a repository. // Users with admin access to the repository can create an autolink. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#create-an-autolink-reference-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) { @@ -65,8 +61,8 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin return nil, nil, err } - al := new(Autolink) - resp, err := s.client.Do(ctx, req, al) + var al *Autolink + resp, err := s.client.Do(ctx, req, &al) if err != nil { return nil, resp, err } @@ -76,7 +72,7 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin // GetAutolink returns a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#get-an-autolink-reference-of-a-repository // //meta:operation GET /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) { @@ -99,7 +95,7 @@ func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo strin // DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#delete-an-autolink-reference-from-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_codeowners.go b/vendor/github.com/google/go-github/v85/github/repos_codeowners.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/repos_codeowners.go rename to vendor/github.com/google/go-github/v85/github/repos_codeowners.go index 93eeae09b..186ae3ea2 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_codeowners.go +++ b/vendor/github.com/google/go-github/v85/github/repos_codeowners.go @@ -36,7 +36,7 @@ type CodeownersError struct { // GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-codeowners-errors +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-codeowners-errors // //meta:operation GET /repos/{owner}/{repo}/codeowners/errors func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string, opts *GetCodeownersErrorsOptions) (*CodeownersErrors, *Response, error) { @@ -51,8 +51,8 @@ func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, re return nil, nil, err } - codeownersErrors := &CodeownersErrors{} - resp, err := s.client.Do(ctx, req, codeownersErrors) + var codeownersErrors *CodeownersErrors + resp, err := s.client.Do(ctx, req, &codeownersErrors) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_collaborators.go b/vendor/github.com/google/go-github/v85/github/repos_collaborators.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v85/github/repos_collaborators.go index a46f45294..4d8f5e5fe 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_collaborators.go +++ b/vendor/github.com/google/go-github/v85/github/repos_collaborators.go @@ -34,7 +34,7 @@ type ListCollaboratorsOptions struct { } // CollaboratorInvitation represents an invitation created when adding a collaborator. -// GitHub API docs: https://docs.github.com/rest/repos/collaborators/#response-when-a-new-invitation-is-created +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#add-a-repository-collaborator type CollaboratorInvitation struct { ID *int64 `json:"id,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -48,7 +48,7 @@ type CollaboratorInvitation struct { // ListCollaborators lists the GitHub users that have access to the repository. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#list-repository-collaborators // //meta:operation GET /repos/{owner}/{repo}/collaborators func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#check-if-a-user-is-a-repository-collaborator // //meta:operation GET /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { @@ -105,7 +105,7 @@ type RepositoryPermissionLevel struct { // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#get-repository-permissions-for-a-user // //meta:operation GET /repos/{owner}/{repo}/collaborators/{username}/permission func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) { @@ -115,8 +115,8 @@ func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, rep return nil, nil, err } - rpl := new(RepositoryPermissionLevel) - resp, err := s.client.Do(ctx, req, rpl) + var rpl *RepositoryPermissionLevel + resp, err := s.client.Do(ctx, req, &rpl) if err != nil { return nil, resp, err } @@ -142,7 +142,7 @@ type RepositoryAddCollaboratorOptions struct { // AddCollaborator sends an invitation to the specified GitHub user // to become a collaborator to the given repo. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#add-a-repository-collaborator // //meta:operation PUT /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) { @@ -152,8 +152,8 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, return nil, nil, err } - acr := new(CollaboratorInvitation) - resp, err := s.client.Do(ctx, req, acr) + var acr *CollaboratorInvitation + resp, err := s.client.Do(ctx, req, &acr) if err != nil { return nil, resp, err } @@ -164,7 +164,7 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#remove-a-repository-collaborator // //meta:operation DELETE /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_comments.go b/vendor/github.com/google/go-github/v85/github/repos_comments.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/repos_comments.go rename to vendor/github.com/google/go-github/v85/github/repos_comments.go index 3d02a1999..e51d3afb6 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_comments.go +++ b/vendor/github.com/google/go-github/v85/github/repos_comments.go @@ -35,7 +35,7 @@ func (r RepositoryComment) String() string { // ListComments lists all the comments for the repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#list-commit-comments-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/comments func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { @@ -63,7 +63,7 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri // ListCommitComments lists all the comments for a given commit SHA. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#list-commit-comments // //meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { @@ -92,7 +92,7 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep // CreateComment creates a comment for the given commit. // Note: GitHub allows for comments to be created for non-existing files and positions. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#create-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#create-a-commit-comment // //meta:operation POST /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) { @@ -102,8 +102,8 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh return nil, nil, err } - c := new(RepositoryComment) - resp, err := s.client.Do(ctx, req, c) + var c *RepositoryComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -113,7 +113,7 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh // GetComment gets a single comment from a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#get-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#get-a-commit-comment // //meta:operation GET /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) { @@ -125,8 +125,8 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string req.Header.Set("Accept", mediaTypeReactionsPreview) - c := new(RepositoryComment) - resp, err := s.client.Do(ctx, req, c) + var c *RepositoryComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -136,7 +136,7 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string // UpdateComment updates the body of a single comment. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#update-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#update-a-commit-comment // //meta:operation PATCH /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) { @@ -146,8 +146,8 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str return nil, nil, err } - c := new(RepositoryComment) - resp, err := s.client.Do(ctx, req, c) + var c *RepositoryComment + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } @@ -157,7 +157,7 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str // DeleteComment deletes a single comment from a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#delete-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#delete-a-commit-comment // //meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) { @@ -166,5 +166,6 @@ func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo str if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v82/github/repos_commits.go b/vendor/github.com/google/go-github/v85/github/repos_commits.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/repos_commits.go rename to vendor/github.com/google/go-github/v85/github/repos_commits.go index 36192cd3e..591696689 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v85/github/repos_commits.go @@ -124,7 +124,7 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-commits // //meta:operation GET /repos/{owner}/{repo}/commits func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { @@ -150,7 +150,7 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#get-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { @@ -165,8 +165,8 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st return nil, nil, err } - commit := new(RepositoryCommit) - resp, err := s.client.Do(ctx, req, commit) + var commit *RepositoryCommit + resp, err := s.client.Do(ctx, req, &commit) if err != nil { return nil, resp, err } @@ -176,7 +176,7 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GetCommitRaw fetches the specified commit in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#get-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner, repo, sha string, opts RawOptions) (string, *Response, error) { @@ -207,7 +207,7 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner, repo, sha // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#get-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { @@ -234,7 +234,7 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits // //meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { @@ -252,8 +252,8 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, b return nil, nil, err } - comp := new(CommitsComparison) - resp, err := s.client.Do(ctx, req, comp) + var comp *CommitsComparison + resp, err := s.client.Do(ctx, req, &comp) if err != nil { return nil, resp, err } @@ -267,7 +267,7 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, b // To compare branches across other repositories in the same network as "repo", // use the format ":branch". // -// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits // //meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) { @@ -302,7 +302,7 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo // ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD, // or latest commit for the branch. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-branches-for-head-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head func (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_community_health.go b/vendor/github.com/google/go-github/v85/github/repos_community_health.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/repos_community_health.go rename to vendor/github.com/google/go-github/v85/github/repos_community_health.go index 54d1b414e..0247ce634 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_community_health.go +++ b/vendor/github.com/google/go-github/v85/github/repos_community_health.go @@ -43,7 +43,7 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://docs.github.com/rest/metrics/community#get-community-profile-metrics +// GitHub API docs: https://docs.github.com/rest/metrics/community?apiVersion=2022-11-28#get-community-profile-metrics // //meta:operation GET /repos/{owner}/{repo}/community/profile func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { @@ -53,8 +53,8 @@ func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, own return nil, nil, err } - metrics := &CommunityHealthMetrics{} - resp, err := s.client.Do(ctx, req, metrics) + var metrics *CommunityHealthMetrics + resp, err := s.client.Do(ctx, req, &metrics) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_contents.go b/vendor/github.com/google/go-github/v85/github/repos_contents.go similarity index 75% rename from vendor/github.com/google/go-github/v82/github/repos_contents.go rename to vendor/github.com/google/go-github/v85/github/repos_contents.go index 6090c8b9f..caf71a3ba 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v85/github/repos_contents.go @@ -4,7 +4,7 @@ // license that can be found in the LICENSE file. // Repository contents API methods. -// GitHub API docs: https://docs.github.com/rest/repos/contents/ +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28 package github @@ -17,12 +17,9 @@ import ( "io" "net/http" "net/url" - "path" "strings" ) -var ErrPathForbidden = errors.New("path must not contain '..' due to auth vulnerability issue") - // RepositoryContent represents a file or directory in a github repository. type RepositoryContent struct { Type *string `json:"type,omitempty"` @@ -48,7 +45,7 @@ type RepositoryContent struct { // RepositoryContentResponse holds the parsed response from CreateFile, UpdateFile, and DeleteFile. type RepositoryContentResponse struct { Content *RepositoryContent `json:"content,omitempty"` - Commit `json:"commit,omitempty"` + Commit `json:"commit"` } // RepositoryContentFileOptions specifies optional parameters for CreateFile, UpdateFile, and DeleteFile. @@ -100,7 +97,7 @@ func (r *RepositoryContent) GetContent() (string, error) { // GetReadme gets the Readme file for the repository. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-a-repository-readme +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-a-repository-readme // //meta:operation GET /repos/{owner}/{repo}/readme func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) { @@ -115,8 +112,8 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, return nil, nil, err } - readme := new(RepositoryContent) - resp, err := s.client.Do(ctx, req, readme) + var readme *RepositoryContent + resp, err := s.client.Do(ctx, req, &readme) if err != nil { return nil, resp, err } @@ -133,44 +130,12 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-repository-content // //meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { - dir := path.Dir(filepath) - filename := path.Base(filepath) - fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) - if err == nil && fileContent != nil { - content, err := fileContent.GetContent() - if err == nil && content != "" { - return io.NopCloser(strings.NewReader(content)), resp, nil - } - } - - _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) - if err != nil { - return nil, resp, err - } - - for _, contents := range dirContents { - if contents.GetName() == filename { - if contents.GetDownloadURL() == "" { - return nil, resp, fmt.Errorf("no download link found for %v", filepath) - } - dlReq, err := http.NewRequestWithContext(ctx, "GET", *contents.DownloadURL, nil) - if err != nil { - return nil, resp, err - } - dlResp, err := s.client.client.Do(dlReq) - if err != nil { - return nil, &Response{Response: dlResp}, err - } - - return dlResp.Body, &Response{Response: dlResp}, nil - } - } - - return nil, resp, fmt.Errorf("no file named %v found in %v", filename, dir) + rc, _, resp, err := s.DownloadContentsWithMeta(ctx, owner, repo, filepath, opts) + return rc, resp, err } // DownloadContentsWithMeta is identical to DownloadContents but additionally @@ -182,44 +147,40 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-repository-content // //meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { - dir := path.Dir(filepath) - filename := path.Base(filepath) fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) - if err == nil && fileContent != nil { - content, err := fileContent.GetContent() - if err == nil && content != "" { - return io.NopCloser(strings.NewReader(content)), fileContent, resp, nil - } + if err != nil { + return nil, nil, resp, err + } + + if fileContent == nil { + return nil, nil, resp, errors.New("no file content found") + } + + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), fileContent, resp, nil + } + + downloadURL := fileContent.GetDownloadURL() + if downloadURL == "" { + return nil, fileContent, resp, errors.New("download url is empty") } - _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) + dlReq, err := http.NewRequestWithContext(ctx, "GET", downloadURL, nil) if err != nil { - return nil, nil, resp, err + return nil, fileContent, resp, err } - for _, contents := range dirContents { - if contents.GetName() == filename { - if contents.GetDownloadURL() == "" { - return nil, contents, resp, fmt.Errorf("no download link found for %v", filepath) - } - dlReq, err := http.NewRequestWithContext(ctx, "GET", *contents.DownloadURL, nil) - if err != nil { - return nil, contents, resp, err - } - dlResp, err := s.client.client.Do(dlReq) - if err != nil { - return nil, contents, &Response{Response: dlResp}, err - } - - return dlResp.Body, contents, &Response{Response: dlResp}, nil - } + dlResp, err := s.client.client.Do(dlReq) + if err != nil { + return nil, fileContent, &Response{Response: dlResp}, err } - return nil, nil, resp, fmt.Errorf("no file named %v found in %v", filename, dir) + return dlResp.Body, fileContent, &Response{Response: dlResp}, nil } // GetContents can return either the metadata and content of a single file @@ -229,17 +190,10 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // as possible, both result types will be returned but only one will contain a // value and the other will be nil. // -// Due to an auth vulnerability issue in the GitHub v3 API, ".." is not allowed -// to appear anywhere in the "path" or this method will return an error. -// -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-repository-content // //meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { - if strings.Contains(path, "..") { - return nil, nil, nil, ErrPathForbidden - } - escapedPath := (&url.URL{Path: strings.TrimSuffix(path, "/")}).String() u := fmt.Sprintf("repos/%v/%v/contents/%v", owner, repo, escapedPath) u, err = addOptions(u, opts) @@ -274,7 +228,7 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents // //meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { @@ -284,8 +238,8 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path return nil, nil, err } - createResponse := new(RepositoryContentResponse) - resp, err := s.client.Do(ctx, req, createResponse) + var createResponse *RepositoryContentResponse + resp, err := s.client.Do(ctx, req, &createResponse) if err != nil { return nil, resp, err } @@ -296,7 +250,7 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents // //meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { @@ -306,8 +260,8 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path return nil, nil, err } - updateResponse := new(RepositoryContentResponse) - resp, err := s.client.Do(ctx, req, updateResponse) + var updateResponse *RepositoryContentResponse + resp, err := s.client.Do(ctx, req, &updateResponse) if err != nil { return nil, resp, err } @@ -318,7 +272,7 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path // DeleteFile deletes a file from a repository and returns the commit. // Requires the blob SHA of the file to be deleted. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#delete-a-file +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#delete-a-file // //meta:operation DELETE /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { @@ -328,8 +282,8 @@ func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path return nil, nil, err } - deleteResponse := new(RepositoryContentResponse) - resp, err := s.client.Do(ctx, req, deleteResponse) + var deleteResponse *RepositoryContentResponse + resp, err := s.client.Do(ctx, req, &deleteResponse) if err != nil { return nil, resp, err } @@ -352,9 +306,9 @@ const ( // repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-tar // -// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-zip // //meta:operation GET /repos/{owner}/{repo}/tarball/{ref} //meta:operation GET /repos/{owner}/{repo}/zipball/{ref} diff --git a/vendor/github.com/google/go-github/v82/github/repos_deployment_branch_policies.go b/vendor/github.com/google/go-github/v85/github/repos_deployment_branch_policies.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/repos_deployment_branch_policies.go rename to vendor/github.com/google/go-github/v85/github/repos_deployment_branch_policies.go index 77ac73e44..cae8122a9 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_deployment_branch_policies.go +++ b/vendor/github.com/google/go-github/v85/github/repos_deployment_branch_policies.go @@ -32,11 +32,15 @@ type DeploymentBranchPolicyRequest struct { // ListDeploymentBranchPolicies lists the deployment branch policies for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#list-deployment-branch-policies // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies -func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string) (*DeploymentBranchPolicyResponse, *Response, error) { +func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string, opts *ListOptions) (*DeploymentBranchPolicyResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -54,7 +58,7 @@ func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, // GetDeploymentBranchPolicy gets a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#get-a-deployment-branch-policy // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) { @@ -76,7 +80,7 @@ func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, own // CreateDeploymentBranchPolicy creates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy // //meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { @@ -98,7 +102,7 @@ func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, // UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#update-a-deployment-branch-policy // //meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { @@ -120,7 +124,7 @@ func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, // DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#delete-a-deployment-branch-policy // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_deployment_protection_rules.go b/vendor/github.com/google/go-github/v85/github/repos_deployment_protection_rules.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/repos_deployment_protection_rules.go rename to vendor/github.com/google/go-github/v85/github/repos_deployment_protection_rules.go index 29d490328..5d5cc3ee6 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_deployment_protection_rules.go +++ b/vendor/github.com/google/go-github/v85/github/repos_deployment_protection_rules.go @@ -45,7 +45,7 @@ type CustomDeploymentProtectionRuleRequest struct { // GetAllDeploymentProtectionRules gets all the deployment protection rules for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#get-all-deployment-protection-rules-for-an-environment // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules func (s *RepositoriesService) GetAllDeploymentProtectionRules(ctx context.Context, owner, repo, environment string) (*ListDeploymentProtectionRuleResponse, *Response, error) { @@ -67,7 +67,7 @@ func (s *RepositoriesService) GetAllDeploymentProtectionRules(ctx context.Contex // CreateCustomDeploymentProtectionRule creates a custom deployment protection rule on an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#create-a-custom-deployment-protection-rule-on-an-environment // //meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules func (s *RepositoriesService) CreateCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, request *CustomDeploymentProtectionRuleRequest) (*CustomDeploymentProtectionRule, *Response, error) { @@ -78,8 +78,8 @@ func (s *RepositoriesService) CreateCustomDeploymentProtectionRule(ctx context.C return nil, nil, err } - protectionRule := new(CustomDeploymentProtectionRule) - resp, err := s.client.Do(ctx, req, protectionRule) + var protectionRule *CustomDeploymentProtectionRule + resp, err := s.client.Do(ctx, req, &protectionRule) if err != nil { return nil, resp, err } @@ -89,11 +89,15 @@ func (s *RepositoriesService) CreateCustomDeploymentProtectionRule(ctx context.C // ListCustomDeploymentRuleIntegrations lists the custom deployment rule integrations for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#list-custom-deployment-rule-integrations-available-for-an-environment // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps -func (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.Context, owner, repo, environment string) (*ListCustomDeploymentRuleIntegrationsResponse, *Response, error) { +func (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.Context, owner, repo, environment string, opts *ListOptions) (*ListCustomDeploymentRuleIntegrationsResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules/apps", owner, repo, environment) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -111,7 +115,7 @@ func (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.C // GetCustomDeploymentProtectionRule gets a custom deployment protection rule for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#get-a-custom-deployment-protection-rule // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} func (s *RepositoriesService) GetCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*CustomDeploymentProtectionRule, *Response, error) { @@ -133,7 +137,7 @@ func (s *RepositoriesService) GetCustomDeploymentProtectionRule(ctx context.Cont // DisableCustomDeploymentProtectionRule disables a custom deployment protection rule for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#disable-a-custom-protection-rule-for-an-environment // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} func (s *RepositoriesService) DisableCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_deployments.go b/vendor/github.com/google/go-github/v85/github/repos_deployments.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/repos_deployments.go rename to vendor/github.com/google/go-github/v85/github/repos_deployments.go index 637067491..8d6b245b1 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v85/github/repos_deployments.go @@ -63,7 +63,7 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#list-deployments +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#list-deployments // //meta:operation GET /repos/{owner}/{repo}/deployments func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) { @@ -89,7 +89,7 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s // GetDeployment returns a single deployment of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#get-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#get-a-deployment // //meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) { @@ -100,8 +100,8 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str return nil, nil, err } - deployment := new(Deployment) - resp, err := s.client.Do(ctx, req, deployment) + var deployment *Deployment + resp, err := s.client.Do(ctx, req, &deployment) if err != nil { return nil, resp, err } @@ -111,7 +111,7 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str // CreateDeployment creates a new deployment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#create-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#create-a-deployment // //meta:operation POST /repos/{owner}/{repo}/deployments func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { @@ -125,8 +125,8 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - d := new(Deployment) - resp, err := s.client.Do(ctx, req, d) + var d *Deployment + resp, err := s.client.Do(ctx, req, &d) if err != nil { return nil, resp, err } @@ -136,7 +136,7 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo // DeleteDeployment deletes an existing deployment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#delete-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#delete-a-deployment // //meta:operation DELETE /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) { @@ -182,7 +182,7 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses +// GitHub API docs: https://docs.github.com/rest/deployments/statuses?apiVersion=2022-11-28#list-deployment-statuses // //meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) { @@ -211,7 +211,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, // GetDeploymentStatus returns a single deployment status of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses?apiVersion=2022-11-28#get-a-deployment-status // //meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) { @@ -225,8 +225,8 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - d := new(DeploymentStatus) - resp, err := s.client.Do(ctx, req, d) + var d *DeploymentStatus + resp, err := s.client.Do(ctx, req, &d) if err != nil { return nil, resp, err } @@ -236,7 +236,7 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re // CreateDeploymentStatus creates a new status for a deployment. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses?apiVersion=2022-11-28#create-a-deployment-status // //meta:operation POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { @@ -250,8 +250,8 @@ func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - d := new(DeploymentStatus) - resp, err := s.client.Do(ctx, req, d) + var d *DeploymentStatus + resp, err := s.client.Do(ctx, req, &d) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_environments.go b/vendor/github.com/google/go-github/v85/github/repos_environments.go similarity index 96% rename from vendor/github.com/google/go-github/v82/github/repos_environments.go rename to vendor/github.com/google/go-github/v85/github/repos_environments.go index 7bc8394ac..ec9985d1b 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_environments.go +++ b/vendor/github.com/google/go-github/v85/github/repos_environments.go @@ -107,7 +107,7 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#list-environments // //meta:operation GET /repos/{owner}/{repo}/environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { @@ -132,12 +132,11 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo // GetEnvironment get a single environment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#get-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#get-an-environment // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v", owner, repo, name) - req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -190,19 +189,18 @@ type createUpdateEnvironmentNoEnterprise struct { // CreateUpdateEnvironment create or update a new environment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#create-or-update-an-environment // //meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v", owner, repo, name) - req, err := s.client.NewRequest("PUT", u, environment) if err != nil { return nil, nil, err } - e := new(Environment) - resp, err := s.client.Do(ctx, req, e) + var e *Environment + resp, err := s.client.Do(ctx, req, &e) if err != nil { // The API returns 422 when the pricing plan doesn't support all the fields sent. // This path will be executed for Pro/Teams private repos. @@ -215,6 +213,7 @@ func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner } return nil, resp, err } + return e, resp, nil } @@ -228,25 +227,26 @@ func (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u st return nil, nil, err } - e := new(Environment) - resp, err := s.client.Do(ctx, req, e) + var e *Environment + resp, err := s.client.Do(ctx, req, &e) if err != nil { return nil, resp, err } + return e, resp, nil } // DeleteEnvironment delete an environment from a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#delete-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#delete-an-environment // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v", owner, repo, name) - req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v82/github/repos_forks.go b/vendor/github.com/google/go-github/v85/github/repos_forks.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/repos_forks.go rename to vendor/github.com/google/go-github/v85/github/repos_forks.go index cffc87e9b..49c9e1667 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_forks.go +++ b/vendor/github.com/google/go-github/v85/github/repos_forks.go @@ -24,7 +24,7 @@ type RepositoryListForksOptions struct { // ListForks lists the forks of the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/forks#list-forks +// GitHub API docs: https://docs.github.com/rest/repos/forks?apiVersion=2022-11-28#list-forks // //meta:operation GET /repos/{owner}/{repo}/forks func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) { @@ -68,7 +68,7 @@ type RepositoryCreateForkOptions struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/repos/forks#create-a-fork +// GitHub API docs: https://docs.github.com/rest/repos/forks?apiVersion=2022-11-28#create-a-fork // //meta:operation POST /repos/{owner}/{repo}/forks func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { @@ -79,20 +79,20 @@ func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string return nil, nil, err } - fork := new(Repository) - resp, err := s.client.Do(ctx, req, fork) + var fork Repository + resp, err := s.client.Do(ctx, req, &fork) if err != nil { // Persist AcceptedError's metadata to the Repository object. var aerr *AcceptedError if errors.As(err, &aerr) { - if err := json.Unmarshal(aerr.Raw, fork); err != nil { - return fork, resp, err + if err := json.Unmarshal(aerr.Raw, &fork); err != nil { + return &fork, resp, err } - return fork, resp, err + return &fork, resp, err } return nil, resp, err } - return fork, resp, nil + return &fork, resp, nil } diff --git a/vendor/github.com/google/go-github/v82/github/repos_hooks.go b/vendor/github.com/google/go-github/v85/github/repos_hooks.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/repos_hooks.go rename to vendor/github.com/google/go-github/v85/github/repos_hooks.go index bbadab800..ba9c26722 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v85/github/repos_hooks.go @@ -80,7 +80,7 @@ type createHookRequest struct { // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#create-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { @@ -102,8 +102,8 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + var h *Hook + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -113,7 +113,7 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string // ListHooks lists all Hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#list-repository-webhooks // //meta:operation GET /repos/{owner}/{repo}/hooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { @@ -139,7 +139,7 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#get-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { @@ -148,8 +148,9 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i if err != nil { return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + + var h *Hook + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -159,7 +160,7 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#update-a-repository-webhook // //meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { @@ -168,8 +169,9 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, if err != nil { return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + + var h *Hook + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -179,7 +181,7 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#delete-a-repository-webhook // //meta:operation DELETE /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { @@ -188,12 +190,13 @@ func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#ping-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/pings func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { @@ -207,7 +210,7 @@ func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, // TestHook triggers a test Hook by github. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#test-the-push-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/tests func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_hooks_configuration.go b/vendor/github.com/google/go-github/v85/github/repos_hooks_configuration.go similarity index 83% rename from vendor/github.com/google/go-github/v82/github/repos_hooks_configuration.go rename to vendor/github.com/google/go-github/v85/github/repos_hooks_configuration.go index 69d1f4060..27df05de5 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_hooks_configuration.go +++ b/vendor/github.com/google/go-github/v85/github/repos_hooks_configuration.go @@ -27,7 +27,7 @@ type HookConfig struct { // GetHookConfiguration returns the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { @@ -37,8 +37,8 @@ func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, r return nil, nil, err } - config := new(HookConfig) - resp, err := s.client.Do(ctx, req, config) + var config *HookConfig + resp, err := s.client.Do(ctx, req, &config) if err != nil { return nil, resp, err } @@ -48,7 +48,7 @@ func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, r // EditHookConfiguration updates the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { @@ -58,8 +58,8 @@ func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, return nil, nil, err } - c := new(HookConfig) - resp, err := s.client.Do(ctx, req, c) + var c *HookConfig + resp, err := s.client.Do(ctx, req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v85/github/repos_hooks_deliveries.go similarity index 86% rename from vendor/github.com/google/go-github/v82/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v85/github/repos_hooks_deliveries.go index 526d82c6f..2386addbf 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v85/github/repos_hooks_deliveries.go @@ -15,8 +15,8 @@ import ( // HookDelivery represents the data that is received from GitHub's Webhook Delivery API // // GitHub API docs: -// - https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook -// - https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries?apiVersion=2022-11-28#list-deliveries-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries?apiVersion=2022-11-28#get-a-delivery-for-a-repository-webhook type HookDelivery struct { ID *int64 `json:"id,omitempty"` GUID *string `json:"guid,omitempty"` @@ -84,7 +84,7 @@ func (r HookResponse) String() string { // ListHookDeliveries lists webhook deliveries for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#list-deliveries-for-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { @@ -110,7 +110,7 @@ func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, rep // GetHookDelivery returns a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#get-a-delivery-for-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { @@ -120,8 +120,8 @@ func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo s return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -131,7 +131,7 @@ func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo s // RedeliverHookDelivery redelivers a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#redeliver-a-delivery-for-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { @@ -141,8 +141,8 @@ func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v85/github/repos_immutable_releases.go b/vendor/github.com/google/go-github/v85/github/repos_immutable_releases.go new file mode 100644 index 000000000..524744496 --- /dev/null +++ b/vendor/github.com/google/go-github/v85/github/repos_immutable_releases.go @@ -0,0 +1,82 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// RepoImmutableReleasesStatus represents the immutable releases status for a repository. +type RepoImmutableReleasesStatus struct { + Enabled *bool `json:"enabled,omitempty"` + EnforcedByOwner *bool `json:"enforced_by_owner,omitempty"` +} + +// EnableImmutableReleases enables immutable releases for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-immutable-releases +// +//meta:operation PUT /repos/{owner}/{repo}/immutable-releases +func (s *RepositoriesService) EnableImmutableReleases(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/immutable-releases", owner, repo) + + req, err := s.client.NewRequest("PUT", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DisableImmutableReleases disables immutable releases for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-immutable-releases +// +//meta:operation DELETE /repos/{owner}/{repo}/immutable-releases +func (s *RepositoriesService) DisableImmutableReleases(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/immutable-releases", owner, repo) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// AreImmutableReleasesEnabled checks if immutable releases are enabled for +// the repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-immutable-releases-are-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/immutable-releases +func (s *RepositoriesService) AreImmutableReleasesEnabled(ctx context.Context, owner, repo string) (*RepoImmutableReleasesStatus, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/immutable-releases", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var status *RepoImmutableReleasesStatus + resp, err := s.client.Do(ctx, req, &status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} diff --git a/vendor/github.com/google/go-github/v82/github/repos_invitations.go b/vendor/github.com/google/go-github/v85/github/repos_invitations.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/repos_invitations.go rename to vendor/github.com/google/go-github/v85/github/repos_invitations.go index 98fe01d1c..ab9d47175 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_invitations.go +++ b/vendor/github.com/google/go-github/v85/github/repos_invitations.go @@ -28,7 +28,7 @@ type RepositoryInvitation struct { // ListInvitations lists all currently-open repository invitations. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#list-repository-invitations // //meta:operation GET /repos/{owner}/{repo}/invitations func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { @@ -54,7 +54,7 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s // DeleteInvitation deletes a repository invitation. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#delete-a-repository-invitation // //meta:operation DELETE /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) { @@ -73,7 +73,7 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo // permissions represents the permissions that the associated user will have // on the repository. Possible values are: "read", "write", "admin". // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#update-a-repository-invitation // //meta:operation PATCH /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) { @@ -86,8 +86,8 @@ func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo return nil, nil, err } - invite := &RepositoryInvitation{} - resp, err := s.client.Do(ctx, req, invite) + var invite *RepositoryInvitation + resp, err := s.client.Do(ctx, req, &invite) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_keys.go b/vendor/github.com/google/go-github/v85/github/repos_keys.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/repos_keys.go rename to vendor/github.com/google/go-github/v85/github/repos_keys.go index 0d050c803..9a8061e0f 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_keys.go +++ b/vendor/github.com/google/go-github/v85/github/repos_keys.go @@ -14,7 +14,7 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#list-deploy-keys // //meta:operation GET /repos/{owner}/{repo}/keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Key, *Response, error) { @@ -40,7 +40,7 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner, repo string, // GetKey fetches a single deploy key. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#get-a-deploy-key // //meta:operation GET /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) GetKey(ctx context.Context, owner, repo string, id int64) (*Key, *Response, error) { @@ -51,8 +51,8 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner, repo string, id return nil, nil, err } - key := new(Key) - resp, err := s.client.Do(ctx, req, key) + var key *Key + resp, err := s.client.Do(ctx, req, &key) if err != nil { return nil, resp, err } @@ -62,7 +62,7 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner, repo string, id // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#create-a-deploy-key // //meta:operation POST /repos/{owner}/{repo}/keys func (s *RepositoriesService) CreateKey(ctx context.Context, owner, repo string, key *Key) (*Key, *Response, error) { @@ -73,8 +73,8 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner, repo string, return nil, nil, err } - k := new(Key) - resp, err := s.client.Do(ctx, req, k) + var k *Key + resp, err := s.client.Do(ctx, req, &k) if err != nil { return nil, resp, err } @@ -84,7 +84,7 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner, repo string, // DeleteKey deletes a deploy key. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#delete-a-deploy-key // //meta:operation DELETE /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) DeleteKey(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_lfs.go b/vendor/github.com/google/go-github/v85/github/repos_lfs.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/repos_lfs.go rename to vendor/github.com/google/go-github/v85/github/repos_lfs.go index f0153c080..4eb4893ae 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_lfs.go +++ b/vendor/github.com/google/go-github/v85/github/repos_lfs.go @@ -12,7 +12,7 @@ import ( // EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#enable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs?apiVersion=2022-11-28#enable-git-lfs-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/lfs func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { @@ -33,7 +33,7 @@ func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) // DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#disable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs?apiVersion=2022-11-28#disable-git-lfs-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/lfs func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_merging.go b/vendor/github.com/google/go-github/v85/github/repos_merging.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/repos_merging.go rename to vendor/github.com/google/go-github/v85/github/repos_merging.go index b26e5da1a..adf76fa9f 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_merging.go +++ b/vendor/github.com/google/go-github/v85/github/repos_merging.go @@ -34,7 +34,7 @@ type RepoMergeUpstreamResult struct { // Merge a branch in the specified repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#merge-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#merge-a-branch // //meta:operation POST /repos/{owner}/{repo}/merges func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { @@ -44,8 +44,8 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req return nil, nil, err } - commit := new(RepositoryCommit) - resp, err := s.client.Do(ctx, req, commit) + var commit *RepositoryCommit + resp, err := s.client.Do(ctx, req, &commit) if err != nil { return nil, resp, err } @@ -56,7 +56,7 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req // MergeUpstream syncs a branch of a forked repository to keep it up-to-date // with the upstream repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#sync-a-fork-branch-with-the-upstream-repository // //meta:operation POST /repos/{owner}/{repo}/merge-upstream func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { @@ -66,8 +66,8 @@ func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo str return nil, nil, err } - result := new(RepoMergeUpstreamResult) - resp, err := s.client.Do(ctx, req, result) + var result *RepoMergeUpstreamResult + resp, err := s.client.Do(ctx, req, &result) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_pages.go b/vendor/github.com/google/go-github/v85/github/repos_pages.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/repos_pages.go rename to vendor/github.com/google/go-github/v85/github/repos_pages.go index 92110f598..9eb02720e 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_pages.go +++ b/vendor/github.com/google/go-github/v85/github/repos_pages.go @@ -104,7 +104,7 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#create-a-github-pages-site // //meta:operation POST /repos/{owner}/{repo}/pages func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { @@ -126,8 +126,8 @@ func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo strin req.Header.Set("Accept", mediaTypeEnablePagesAPIPreview) - enable := new(Pages) - resp, err := s.client.Do(ctx, req, enable) + var enable *Pages + resp, err := s.client.Do(ctx, req, &enable) if err != nil { return nil, resp, err } @@ -160,7 +160,7 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#update-information-about-a-github-pages-site // //meta:operation PUT /repos/{owner}/{repo}/pages func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { @@ -189,7 +189,7 @@ type PagesUpdateWithoutCNAME struct { // UpdatePagesGHES updates GitHub Pages for the named repo in GitHub Enterprise Servers. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#update-information-about-a-github-pages-site // //meta:operation PUT /repos/{owner}/{repo}/pages func (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo string, opts *PagesUpdateWithoutCNAME) (*Response, error) { @@ -209,7 +209,7 @@ func (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo s // DisablePages disables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#delete-a-github-pages-site // //meta:operation DELETE /repos/{owner}/{repo}/pages func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { @@ -226,7 +226,7 @@ func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo stri // GetPagesInfo fetches information about a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-a-github-pages-site // //meta:operation GET /repos/{owner}/{repo}/pages func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { @@ -236,8 +236,8 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri return nil, nil, err } - site := new(Pages) - resp, err := s.client.Do(ctx, req, site) + var site *Pages + resp, err := s.client.Do(ctx, req, &site) if err != nil { return nil, resp, err } @@ -247,7 +247,7 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#list-github-pages-builds // //meta:operation GET /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { @@ -273,7 +273,7 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-latest-pages-build // //meta:operation GET /repos/{owner}/{repo}/pages/builds/latest func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { @@ -283,8 +283,8 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re return nil, nil, err } - build := new(PagesBuild) - resp, err := s.client.Do(ctx, req, build) + var build *PagesBuild + resp, err := s.client.Do(ctx, req, &build) if err != nil { return nil, resp, err } @@ -294,7 +294,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-github-pages-build // //meta:operation GET /repos/{owner}/{repo}/pages/builds/{build_id} func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { @@ -304,8 +304,8 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri return nil, nil, err } - build := new(PagesBuild) - resp, err := s.client.Do(ctx, req, build) + var build *PagesBuild + resp, err := s.client.Do(ctx, req, &build) if err != nil { return nil, resp, err } @@ -315,7 +315,7 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#request-a-github-pages-build // //meta:operation POST /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { @@ -325,8 +325,8 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo return nil, nil, err } - build := new(PagesBuild) - resp, err := s.client.Do(ctx, req, build) + var build *PagesBuild + resp, err := s.client.Do(ctx, req, &build) if err != nil { return nil, resp, err } @@ -336,7 +336,7 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPageHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-a-dns-health-check-for-github-pages // //meta:operation GET /repos/{owner}/{repo}/pages/health func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { @@ -346,8 +346,8 @@ func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, rep return nil, nil, err } - healthCheckResponse := new(PagesHealthCheckResponse) - resp, err := s.client.Do(ctx, req, healthCheckResponse) + var healthCheckResponse *PagesHealthCheckResponse + resp, err := s.client.Do(ctx, req, &healthCheckResponse) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v85/github/repos_prereceive_hooks.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v85/github/repos_prereceive_hooks.go index 06c87f55f..3025c0f4b 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_prereceive_hooks.go +++ b/vendor/github.com/google/go-github/v85/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -52,7 +52,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -64,8 +64,8 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypePreReceiveHooksPreview) - h := new(PreReceiveHook) - resp, err := s.client.Do(ctx, req, h) + var h *PreReceiveHook + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -75,7 +75,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -87,8 +87,8 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r req.Header.Set("Accept", mediaTypePreReceiveHooksPreview) - h := new(PreReceiveHook) - resp, err := s.client.Do(ctx, req, h) + var h *PreReceiveHook + resp, err := s.client.Do(ctx, req, &h) if err != nil { return nil, resp, err } @@ -98,7 +98,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_properties.go b/vendor/github.com/google/go-github/v85/github/repos_properties.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/repos_properties.go rename to vendor/github.com/google/go-github/v85/github/repos_properties.go index 5b12bc8b3..61fbcb442 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_properties.go +++ b/vendor/github.com/google/go-github/v85/github/repos_properties.go @@ -12,7 +12,7 @@ import ( // GetAllCustomPropertyValues gets all custom property values that are set for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/custom-properties?apiVersion=2022-11-28#get-all-custom-property-values-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/properties/values func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, org, repo string) ([]*CustomPropertyValue, *Response, error) { @@ -34,7 +34,7 @@ func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, or // CreateOrUpdateCustomProperties creates new or updates existing custom property values for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/custom-properties?apiVersion=2022-11-28#create-or-update-custom-property-values-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/properties/values func (s *RepositoriesService) CreateOrUpdateCustomProperties(ctx context.Context, org, repo string, customPropertyValues []*CustomPropertyValue) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_releases.go b/vendor/github.com/google/go-github/v85/github/repos_releases.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/repos_releases.go rename to vendor/github.com/google/go-github/v85/github/repos_releases.go index ba35d8041..a0876cf38 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v85/github/repos_releases.go @@ -90,7 +90,7 @@ func (r ReleaseAsset) String() string { // ListReleases lists the releases for a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#list-releases +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#list-releases // //meta:operation GET /repos/{owner}/{repo}/releases func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) { @@ -115,7 +115,7 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri // GetRelease fetches a single release. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#get-a-release // //meta:operation GET /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) { @@ -125,7 +125,7 @@ func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string // GetLatestRelease fetches the latest published release for the repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-the-latest-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release // //meta:operation GET /repos/{owner}/{repo}/releases/latest func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) { @@ -135,7 +135,7 @@ func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo // GetReleaseByTag fetches a release with the specified tag. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#get-a-release-by-tag-name // //meta:operation GET /repos/{owner}/{repo}/releases/tags/{tag} func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) { @@ -145,7 +145,7 @@ func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, // GenerateReleaseNotes generates the release notes for the given tag. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release // //meta:operation POST /repos/{owner}/{repo}/releases/generate-notes func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { @@ -155,8 +155,8 @@ func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, r return nil, nil, err } - r := new(RepositoryReleaseNotes) - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryReleaseNotes + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } @@ -170,11 +170,12 @@ func (s *RepositoriesService) getSingleRelease(ctx context.Context, url string) return nil, nil, err } - release := new(RepositoryRelease) - resp, err := s.client.Do(ctx, req, release) + var release *RepositoryRelease + resp, err := s.client.Do(ctx, req, &release) if err != nil { return nil, resp, err } + return release, resp, nil } @@ -201,7 +202,7 @@ type repositoryReleaseRequest struct { // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#create-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#create-a-release // //meta:operation POST /repos/{owner}/{repo}/releases func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { @@ -228,11 +229,12 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str return nil, nil, err } - r := new(RepositoryRelease) - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryRelease + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } + return r, resp, nil } @@ -241,7 +243,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#update-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#update-a-release // //meta:operation PATCH /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { @@ -267,17 +269,18 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin return nil, nil, err } - r := new(RepositoryRelease) - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryRelease + resp, err := s.client.Do(ctx, req, &r) if err != nil { return nil, resp, err } + return r, resp, nil } // DeleteRelease delete a single release from a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#delete-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#delete-a-release // //meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) { @@ -292,7 +295,7 @@ func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo str // ListReleaseAssets lists the release's assets. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#list-release-assets +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#list-release-assets // //meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) { @@ -317,7 +320,7 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo // GetReleaseAsset fetches a single release asset. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#get-a-release-asset // //meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) { @@ -328,11 +331,12 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(ctx, req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } @@ -349,7 +353,7 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // it's necessary to pass an http.Client that performs authenticated requests. // If nil is passed the redirectURL will be returned instead. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#get-a-release-asset // //meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) { @@ -361,36 +365,27 @@ func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, r } req.Header.Set("Accept", defaultMediaType) - s.client.clientMu.Lock() - defer s.client.clientMu.Unlock() - - var loc string - saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { - loc = req.URL.String() - return errors.New("disable redirect") + loc, resp, err := s.client.bareDoUntilFound(ctx, req, 10) + if err != nil { + return nil, "", err } - defer func() { s.client.client.CheckRedirect = saveRedirect }() - req = withContext(ctx, req) - resp, err := s.client.client.Do(req) - if err != nil { - if !strings.Contains(err.Error(), "disable redirect") { - return nil, "", err - } - if followRedirectsClient != nil { - rc, err := s.downloadReleaseAssetFromURL(ctx, followRedirectsClient, loc) - return rc, "", err - } - return nil, loc, nil // Intentionally return no error with valid redirect URL. + // No redirect, stream the response body directly. + if loc == nil { + return resp.Body, "", nil } - if err := CheckResponse(resp); err != nil { - _ = resp.Body.Close() - return nil, "", err + // Close body as it's not needed when following redirects or returning the redirect URL. + _ = resp.Body.Close() + + // Got a redirect URL. + redirectStr := loc.String() + if followRedirectsClient != nil { + rc, err := s.downloadReleaseAssetFromURL(ctx, followRedirectsClient, redirectStr) + return rc, "", err } - return resp.Body, "", nil + return nil, redirectStr, nil } func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, followRedirectsClient *http.Client, url string) (rc io.ReadCloser, err error) { @@ -413,7 +408,7 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f // EditReleaseAsset edits a repository release asset. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#update-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#update-a-release-asset // //meta:operation PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) { @@ -424,17 +419,18 @@ func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(ctx, req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } // DeleteReleaseAsset delete a single release asset from a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#delete-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#delete-a-release-asset // //meta:operation DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) { @@ -450,7 +446,7 @@ func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, rep // UploadReleaseAsset creates an asset by uploading a file into a release repository. // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset // //meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { @@ -482,11 +478,12 @@ func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, rep return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(ctx, req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } @@ -497,7 +494,7 @@ func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, rep // templated like "https://uploads.github.com/.../assets{?name,label}") and uploads // the provided data (reader + size) using the existing upload helpers. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset // //meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) UploadReleaseAssetFromRelease( @@ -555,10 +552,11 @@ func (s *RepositoriesService) UploadReleaseAssetFromRelease( return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(ctx, req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } diff --git a/vendor/github.com/google/go-github/v82/github/repos_rules.go b/vendor/github.com/google/go-github/v85/github/repos_rules.go similarity index 87% rename from vendor/github.com/google/go-github/v82/github/repos_rules.go rename to vendor/github.com/google/go-github/v85/github/repos_rules.go index b02df3131..612a07ced 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_rules.go +++ b/vendor/github.com/google/go-github/v85/github/repos_rules.go @@ -12,7 +12,7 @@ import ( // GetRulesForBranch gets all the repository rules that apply to the specified branch. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-rules-for-a-branch // //meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string, opts *ListOptions) (*BranchRules, *Response, error) { @@ -49,7 +49,7 @@ type RepositoryListRulesetsOptions struct { // By default, this endpoint will include rulesets configured at the organization or enterprise level that apply to the repository. // To exclude those rulesets, set the `RepositoryListRulesetsOptions.IncludesParents` parameter to `false`. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-all-repository-rulesets // //meta:operation GET /repos/{owner}/{repo}/rulesets func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, opts *RepositoryListRulesetsOptions) ([]*RepositoryRuleset, *Response, error) { @@ -76,7 +76,7 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st // CreateRuleset creates a repository ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset // //meta:operation POST /repos/{owner}/{repo}/rulesets func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { @@ -99,7 +99,7 @@ func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo str // GetRuleset gets a repository ruleset for the specified repository. // If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-a-repository-ruleset // //meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*RepositoryRuleset, *Response, error) { @@ -121,7 +121,7 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string // UpdateRuleset updates a repository ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#update-a-repository-ruleset // //meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { @@ -143,7 +143,7 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str // DeleteRuleset deletes a repository ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#delete-a-repository-ruleset // //meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_stats.go b/vendor/github.com/google/go-github/v85/github/repos_stats.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/repos_stats.go rename to vendor/github.com/google/go-github/v85/github/repos_stats.go index b05bae6da..373492c03 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_stats.go +++ b/vendor/github.com/google/go-github/v85/github/repos_stats.go @@ -45,7 +45,7 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-all-contributor-commit-activity // //meta:operation GET /repos/{owner}/{repo}/stats/contributors func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { @@ -86,7 +86,7 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-last-year-of-commit-activity // //meta:operation GET /repos/{owner}/{repo}/stats/commit_activity func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { @@ -115,7 +115,7 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-weekly-commit-activity // //meta:operation GET /repos/{owner}/{repo}/stats/code_frequency func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { @@ -173,7 +173,7 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-weekly-commit-count // //meta:operation GET /repos/{owner}/{repo}/stats/participation func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { @@ -183,8 +183,8 @@ func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo return nil, nil, err } - participation := new(RepositoryParticipation) - resp, err := s.client.Do(ctx, req, participation) + var participation *RepositoryParticipation + resp, err := s.client.Do(ctx, req, &participation) if err != nil { return nil, resp, err } @@ -208,7 +208,7 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-hourly-commit-count-for-each-day // //meta:operation GET /repos/{owner}/{repo}/stats/punch_card func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_statuses.go b/vendor/github.com/google/go-github/v85/github/repos_statuses.go similarity index 92% rename from vendor/github.com/google/go-github/v82/github/repos_statuses.go rename to vendor/github.com/google/go-github/v85/github/repos_statuses.go index 547cc1f12..d15ccda1f 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/v85/github/repos_statuses.go @@ -45,7 +45,7 @@ func (r RepoStatus) String() string { // ListStatuses lists the statuses of a repository at the specified // reference. The ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses?apiVersion=2022-11-28#list-commit-statuses-for-a-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/statuses func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { @@ -72,7 +72,7 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // CreateStatus creates a new status for a repository at the specified // reference. The ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status +// GitHub API docs: https://docs.github.com/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status // //meta:operation POST /repos/{owner}/{repo}/statuses/{sha} func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status RepoStatus) (*RepoStatus, *Response, error) { @@ -82,8 +82,8 @@ func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref return nil, nil, err } - repoStatus := new(RepoStatus) - resp, err := s.client.Do(ctx, req, repoStatus) + var repoStatus *RepoStatus + resp, err := s.client.Do(ctx, req, &repoStatus) if err != nil { return nil, resp, err } @@ -113,7 +113,7 @@ func (s CombinedStatus) String() string { // GetCombinedStatus returns the combined status of a repository at the specified // reference. The ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses?apiVersion=2022-11-28#get-the-combined-status-for-a-specific-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/status func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { @@ -128,8 +128,8 @@ func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo return nil, nil, err } - status := new(CombinedStatus) - resp, err := s.client.Do(ctx, req, status) + var status *CombinedStatus + resp, err := s.client.Do(ctx, req, &status) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/repos_tags.go b/vendor/github.com/google/go-github/v85/github/repos_tags.go similarity index 76% rename from vendor/github.com/google/go-github/v82/github/repos_tags.go rename to vendor/github.com/google/go-github/v85/github/repos_tags.go index 9c789cc82..a9253f77b 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_tags.go +++ b/vendor/github.com/google/go-github/v85/github/repos_tags.go @@ -24,9 +24,9 @@ type tagProtectionRequest struct { // ListTagProtection lists tag protection of the specified repository. // -// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-all-repository-rulesets // -// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { @@ -48,9 +48,9 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // CreateTagProtection creates the tag protection of the specified repository. // -// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { @@ -61,8 +61,8 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re return nil, nil, err } - tagProtection := new(TagProtection) - resp, err := s.client.Do(ctx, req, tagProtection) + var tagProtection *TagProtection + resp, err := s.client.Do(ctx, req, &tagProtection) if err != nil { return nil, resp, err } @@ -72,9 +72,9 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // DeleteTagProtection deletes a tag protection from the specified repository. // -// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#delete-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/repos_traffic.go b/vendor/github.com/google/go-github/v85/github/repos_traffic.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/repos_traffic.go rename to vendor/github.com/google/go-github/v85/github/repos_traffic.go index ae2f1a86b..f41b8dfc0 100644 --- a/vendor/github.com/google/go-github/v82/github/repos_traffic.go +++ b/vendor/github.com/google/go-github/v85/github/repos_traffic.go @@ -54,7 +54,7 @@ type TrafficBreakdownOptions struct { // ListTrafficReferrers list the top 10 referrers over the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-top-referral-sources // //meta:operation GET /repos/{owner}/{repo}/traffic/popular/referrers func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) { @@ -76,7 +76,7 @@ func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, r // ListTrafficPaths list the top 10 popular content over the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-top-referral-paths // //meta:operation GET /repos/{owner}/{repo}/traffic/popular/paths func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) { @@ -98,7 +98,7 @@ func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo // ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-page-views +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-page-views // //meta:operation GET /repos/{owner}/{repo}/traffic/views func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) { @@ -113,7 +113,7 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo return nil, nil, err } - trafficViews := new(TrafficViews) + var trafficViews *TrafficViews resp, err := s.client.Do(ctx, req, &trafficViews) if err != nil { return nil, resp, err @@ -124,7 +124,7 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-repository-clones +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-repository-clones // //meta:operation GET /repos/{owner}/{repo}/traffic/clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { @@ -139,7 +139,7 @@ func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo return nil, nil, err } - trafficClones := new(TrafficClones) + var trafficClones *TrafficClones resp, err := s.client.Do(ctx, req, &trafficClones) if err != nil { return nil, resp, err diff --git a/vendor/github.com/google/go-github/v82/github/rules.go b/vendor/github.com/google/go-github/v85/github/rules.go similarity index 97% rename from vendor/github.com/google/go-github/v82/github/rules.go rename to vendor/github.com/google/go-github/v85/github/rules.go index 009a5033f..d4e94edc2 100644 --- a/vendor/github.com/google/go-github/v82/github/rules.go +++ b/vendor/github.com/google/go-github/v85/github/rules.go @@ -1239,7 +1239,14 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Type = w.Type switch r.Type { - case RulesetRuleTypeCreation: + case RulesetRuleTypeCreation, + RulesetRuleTypeDeletion, + RulesetRuleTypeRequiredLinearHistory, + RulesetRuleTypeRequiredSignatures, + RulesetRuleTypeNonFastForward, + RulesetRuleTypeRepositoryCreate, + RulesetRuleTypeRepositoryDelete, + RulesetRuleTypeRepositoryTransfer: r.Parameters = nil case RulesetRuleTypeUpdate: p := &UpdateRuleParameters{} @@ -1251,10 +1258,6 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { } r.Parameters = p - case RulesetRuleTypeDeletion: - r.Parameters = nil - case RulesetRuleTypeRequiredLinearHistory: - r.Parameters = nil case RulesetRuleTypeMergeQueue: p := &MergeQueueRuleParameters{} @@ -1275,8 +1278,6 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { } r.Parameters = p - case RulesetRuleTypeRequiredSignatures: - r.Parameters = nil case RulesetRuleTypePullRequest: p := &PullRequestRuleParameters{} @@ -1297,49 +1298,11 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { } r.Parameters = p - case RulesetRuleTypeNonFastForward: - r.Parameters = nil - case RulesetRuleTypeCommitMessagePattern: - p := &PatternRuleParameters{} - - if w.Parameters != nil { - if err := json.Unmarshal(w.Parameters, p); err != nil { - return err - } - } - - r.Parameters = p - case RulesetRuleTypeCommitAuthorEmailPattern: - p := &PatternRuleParameters{} - - if w.Parameters != nil { - if err := json.Unmarshal(w.Parameters, p); err != nil { - return err - } - } - - r.Parameters = p - case RulesetRuleTypeCommitterEmailPattern: - p := &PatternRuleParameters{} - - if w.Parameters != nil { - if err := json.Unmarshal(w.Parameters, p); err != nil { - return err - } - } - - r.Parameters = p - case RulesetRuleTypeBranchNamePattern: - p := &PatternRuleParameters{} - - if w.Parameters != nil { - if err := json.Unmarshal(w.Parameters, p); err != nil { - return err - } - } - - r.Parameters = p - case RulesetRuleTypeTagNamePattern: + case RulesetRuleTypeCommitMessagePattern, + RulesetRuleTypeCommitAuthorEmailPattern, + RulesetRuleTypeCommitterEmailPattern, + RulesetRuleTypeBranchNamePattern, + RulesetRuleTypeTagNamePattern: p := &PatternRuleParameters{} if w.Parameters != nil { @@ -1419,10 +1382,6 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { } r.Parameters = p - case RulesetRuleTypeRepositoryCreate: - r.Parameters = nil - case RulesetRuleTypeRepositoryDelete: - r.Parameters = nil case RulesetRuleTypeRepositoryName: p := &SimplePatternRuleParameters{} @@ -1433,8 +1392,6 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { } r.Parameters = p - case RulesetRuleTypeRepositoryTransfer: - r.Parameters = nil case RulesetRuleTypeRepositoryVisibility: p := &RepositoryVisibilityRuleParameters{} diff --git a/vendor/github.com/google/go-github/v82/github/scim.go b/vendor/github.com/google/go-github/v85/github/scim.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/scim.go rename to vendor/github.com/google/go-github/v85/github/scim.go index 8e89796a4..73939cb31 100644 --- a/vendor/github.com/google/go-github/v82/github/scim.go +++ b/vendor/github.com/google/go-github/v85/github/scim.go @@ -14,12 +14,12 @@ import ( // SCIMService provides access to SCIM related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/scim +// GitHub API docs: https://docs.github.com/rest/scim?apiVersion=2022-11-28 type SCIMService service // SCIMUserAttributes represents supported SCIM User attributes. // -// GitHub Enterprise Cloud API docs: https://docs.github.com/rest/scim#supported-scim-user-attributes +// GitHub Enterprise Cloud API docs: https://docs.github.com/rest/scim?apiVersion=2022-11-28#supported-scim-user-attributes // GitHub Enterprise Server API docs: https://docs.github.com/en/enterprise-server@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#supported-scim-user-attributes type SCIMUserAttributes struct { UserName string `json:"userName"` // Configured by the admin. Could be an email, login, or username. (Required.) @@ -95,7 +95,7 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#list-scim-provisioned-identities // //meta:operation GET /scim/v2/organizations/{org}/Users func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { @@ -110,8 +110,8 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str return nil, nil, err } - identities := new(SCIMProvisionedIdentities) - resp, err := s.client.Do(ctx, req, identities) + var identities *SCIMProvisionedIdentities + resp, err := s.client.Do(ctx, req, &identities) if err != nil { return nil, resp, err } @@ -121,7 +121,7 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#provision-and-invite-a-scim-user // //meta:operation POST /scim/v2/organizations/{org}/Users func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*SCIMUserAttributes, *Response, error) { @@ -132,8 +132,8 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string return nil, nil, err } - user := new(SCIMUserAttributes) - resp, err := s.client.Do(ctx, req, user) + var user *SCIMUserAttributes + resp, err := s.client.Do(ctx, req, &user) if err != nil { return nil, resp, err } @@ -143,7 +143,7 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#get-scim-provisioning-information-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-a-user // //meta:operation GET /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { @@ -153,7 +153,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s return nil, nil, err } - user := new(SCIMUserAttributes) + var user *SCIMUserAttributes resp, err := s.client.Do(ctx, req, &user) if err != nil { return nil, resp, err @@ -164,7 +164,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#update-a-provisioned-organization-membership // //meta:operation PUT /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { @@ -199,7 +199,7 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-user // //meta:operation PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { @@ -219,7 +219,7 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#delete-a-scim-user-from-an-organization // //meta:operation DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/search.go b/vendor/github.com/google/go-github/v85/github/search.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/search.go rename to vendor/github.com/google/go-github/v85/github/search.go index aa99786f7..0902be094 100644 --- a/vendor/github.com/google/go-github/v82/github/search.go +++ b/vendor/github.com/google/go-github/v85/github/search.go @@ -32,7 +32,7 @@ import ( // For example, querying with "language:c++" and "leveldb", then query should be // "language:c++ leveldb" but not "language:c+++leveldb". // -// GitHub API docs: https://docs.github.com/rest/search/ +// GitHub API docs: https://docs.github.com/rest/search?apiVersion=2022-11-28 type SearchService service // SearchOptions specifies optional parameters to the SearchService methods. @@ -75,12 +75,12 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-repositories +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-repositories // //meta:operation GET /search/repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { - result := new(RepositoriesSearchResult) - resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) + var result *RepositoriesSearchResult + resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -113,12 +113,12 @@ type TopicResult struct { // Please see https://help.github.com/articles/searching-topics for more // information about search qualifiers. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-topics +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-topics // //meta:operation GET /search/topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { - result := new(TopicsSearchResult) - resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) + var result *TopicsSearchResult + resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -150,12 +150,12 @@ type CommitResult struct { // Commits searches commits via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-commits +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-commits // //meta:operation GET /search/commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { - result := new(CommitsSearchResult) - resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) + var result *CommitsSearchResult + resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -172,12 +172,12 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-issues-and-pull-requests // //meta:operation GET /search/issues func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { - result := new(IssuesSearchResult) - resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) + var result *IssuesSearchResult + resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -194,12 +194,12 @@ type UsersSearchResult struct { // Users searches users via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-users +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-users // //meta:operation GET /search/users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { - result := new(UsersSearchResult) - resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) + var result *UsersSearchResult + resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -249,12 +249,12 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-code +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-code // //meta:operation GET /search/code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { - result := new(CodeSearchResult) - resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) + var result *CodeSearchResult + resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -286,12 +286,12 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-labels +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-labels // //meta:operation GET /search/labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { - result := new(LabelsSearchResult) - resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) + var result *LabelsSearchResult + resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -325,17 +325,14 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter case "commits": // Accept header for search commits preview endpoint acceptHeaders = append(acceptHeaders, mediaTypeCommitSearchPreview) - case "topics": - // Accept header for search repositories based on topics preview endpoint - acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) - case "repositories": + case "topics", "repositories": // Accept header for search repositories based on topics preview endpoint acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) case "issues": // Accept header for search issues based on reactions preview endpoint acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) } - // https://docs.github.com/rest/search#search-repositories + // https://docs.github.com/rest/search?apiVersion=2022-11-28#search-repositories // Accept header defaults to "application/vnd.github.v3+json" // We change it here to fetch back text-match metadata if opts != nil && opts.TextMatch { diff --git a/vendor/github.com/google/go-github/v82/github/secret_scanning.go b/vendor/github.com/google/go-github/v85/github/secret_scanning.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/secret_scanning.go rename to vendor/github.com/google/go-github/v85/github/secret_scanning.go index 248abadc6..7c11886f4 100644 --- a/vendor/github.com/google/go-github/v82/github/secret_scanning.go +++ b/vendor/github.com/google/go-github/v85/github/secret_scanning.go @@ -99,9 +99,9 @@ type SecretScanningAlertListOptions struct { // List options can vary on the Enterprise type. // On Enterprise Cloud, Secret Scan alerts support requesting by page number // along with providing a cursor for an "after" param. - // See: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-organization // Whereas on Enterprise Server, pagination is by index. - // See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-organization ListOptions } @@ -172,7 +172,7 @@ type SecretScanningScanHistory struct { // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { @@ -201,7 +201,7 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-organization // //meta:operation GET /orgs/{org}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { @@ -230,7 +230,7 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { @@ -259,7 +259,7 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#get-a-secret-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { @@ -284,7 +284,7 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#update-a-secret-scanning-alert // //meta:operation PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { @@ -309,7 +309,7 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-locations-for-a-secret-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { @@ -338,7 +338,7 @@ func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#create-a-push-protection-bypass // //meta:operation POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses func (s *SecretScanningService) CreatePushProtectionBypass(ctx context.Context, owner, repo string, request PushProtectionBypassRequest) (*PushProtectionBypass, *Response, error) { @@ -362,7 +362,7 @@ func (s *SecretScanningService) CreatePushProtectionBypass(ctx context.Context, // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope and gitHub advanced security or secret scanning must be enabled. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#get-secret-scanning-scan-history-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/scan-history func (s *SecretScanningService) GetScanHistory(ctx context.Context, owner, repo string) (*SecretScanningScanHistory, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/secret_scanning_pattern_configs.go b/vendor/github.com/google/go-github/v85/github/secret_scanning_pattern_configs.go similarity index 95% rename from vendor/github.com/google/go-github/v82/github/secret_scanning_pattern_configs.go rename to vendor/github.com/google/go-github/v85/github/secret_scanning_pattern_configs.go index 5eb51c459..cd8631249 100644 --- a/vendor/github.com/google/go-github/v82/github/secret_scanning_pattern_configs.go +++ b/vendor/github.com/google/go-github/v85/github/secret_scanning_pattern_configs.go @@ -78,7 +78,7 @@ type SecretScanningCustomPatternSetting struct { // ListPatternConfigsForEnterprise lists the secret scanning pattern configurations for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#list-enterprise-pattern-configurations +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection?apiVersion=2022-11-28#list-enterprise-pattern-configurations // //meta:operation GET /enterprises/{enterprise}/secret-scanning/pattern-configurations func (s *SecretScanningService) ListPatternConfigsForEnterprise(ctx context.Context, enterprise string) (*SecretScanningPatternConfigs, *Response, error) { @@ -100,7 +100,7 @@ func (s *SecretScanningService) ListPatternConfigsForEnterprise(ctx context.Cont // ListPatternConfigsForOrg lists the secret scanning pattern configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#list-organization-pattern-configurations +// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection?apiVersion=2022-11-28#list-organization-pattern-configurations // //meta:operation GET /orgs/{org}/secret-scanning/pattern-configurations func (s *SecretScanningService) ListPatternConfigsForOrg(ctx context.Context, org string) (*SecretScanningPatternConfigs, *Response, error) { @@ -122,7 +122,7 @@ func (s *SecretScanningService) ListPatternConfigsForOrg(ctx context.Context, or // UpdatePatternConfigsForEnterprise updates the secret scanning pattern configurations for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#update-enterprise-pattern-configurations +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection?apiVersion=2022-11-28#update-enterprise-pattern-configurations // //meta:operation PATCH /enterprises/{enterprise}/secret-scanning/pattern-configurations func (s *SecretScanningService) UpdatePatternConfigsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) { @@ -144,7 +144,7 @@ func (s *SecretScanningService) UpdatePatternConfigsForEnterprise(ctx context.Co // UpdatePatternConfigsForOrg updates the secret scanning pattern configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#update-organization-pattern-configurations +// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection?apiVersion=2022-11-28#update-organization-pattern-configurations // //meta:operation PATCH /orgs/{org}/secret-scanning/pattern-configurations func (s *SecretScanningService) UpdatePatternConfigsForOrg(ctx context.Context, org string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/security_advisories.go b/vendor/github.com/google/go-github/v85/github/security_advisories.go similarity index 93% rename from vendor/github.com/google/go-github/v82/github/security_advisories.go rename to vendor/github.com/google/go-github/v85/github/security_advisories.go index 5c7b8fd4e..306f50ded 100644 --- a/vendor/github.com/google/go-github/v82/github/security_advisories.go +++ b/vendor/github.com/google/go-github/v85/github/security_advisories.go @@ -15,7 +15,7 @@ import ( // SecurityAdvisoriesService handles communication with the security advisories // related methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories?apiVersion=2022-11-28 type SecurityAdvisoriesService service // SecurityAdvisorySubmission represents the Security Advisory Submission. @@ -131,7 +131,7 @@ type Credit struct { // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#request-a-cve-for-a-repository-security-advisory // //meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { @@ -157,7 +157,7 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, // CreateTemporaryPrivateFork creates a temporary private fork to collaborate on fixing a security vulnerability in your repository. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#create-a-temporary-private-fork // //meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks func (s *SecurityAdvisoriesService) CreateTemporaryPrivateFork(ctx context.Context, owner, repo, ghsaID string) (*Repository, *Response, error) { @@ -168,26 +168,26 @@ func (s *SecurityAdvisoriesService) CreateTemporaryPrivateFork(ctx context.Conte return nil, nil, err } - fork := new(Repository) - resp, err := s.client.Do(ctx, req, fork) + var fork Repository + resp, err := s.client.Do(ctx, req, &fork) if err != nil { var aerr *AcceptedError if errors.As(err, &aerr) { - if err := json.Unmarshal(aerr.Raw, fork); err != nil { - return fork, resp, err + if err := json.Unmarshal(aerr.Raw, &fork); err != nil { + return &fork, resp, err } - return fork, resp, err + return &fork, resp, err } return nil, resp, err } - return fork, resp, nil + return &fork, resp, nil } // ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization // //meta:operation GET /orgs/{org}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx context.Context, org string, opts *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { @@ -213,7 +213,7 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx c // ListRepositorySecurityAdvisories lists the security advisories in a repository. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories // //meta:operation GET /repos/{owner}/{repo}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context.Context, owner, repo string, opts *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { @@ -239,7 +239,7 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context // ListGlobalSecurityAdvisories lists all global security advisories. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories?apiVersion=2022-11-28#list-global-security-advisories // //meta:operation GET /advisories func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Context, opts *ListGlobalSecurityAdvisoriesOptions) ([]*GlobalSecurityAdvisory, *Response, error) { @@ -265,7 +265,7 @@ func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Con // GetGlobalSecurityAdvisories gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory +// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories?apiVersion=2022-11-28#get-a-global-security-advisory // //meta:operation GET /advisories/{ghsa_id} func (s *SecurityAdvisoriesService) GetGlobalSecurityAdvisories(ctx context.Context, ghsaID string) (*GlobalSecurityAdvisory, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/strings.go b/vendor/github.com/google/go-github/v85/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v82/github/strings.go rename to vendor/github.com/google/go-github/v85/github/strings.go diff --git a/vendor/github.com/google/go-github/v82/github/sub_issue.go b/vendor/github.com/google/go-github/v85/github/sub_issue.go similarity index 90% rename from vendor/github.com/google/go-github/v82/github/sub_issue.go rename to vendor/github.com/google/go-github/v85/github/sub_issue.go index 2effcc5af..4826ee8da 100644 --- a/vendor/github.com/google/go-github/v82/github/sub_issue.go +++ b/vendor/github.com/google/go-github/v85/github/sub_issue.go @@ -15,7 +15,7 @@ import ( // // Sub-issues help you group and manage your issues with a parent/child relationship. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28 type SubIssueService service // SubIssue represents a GitHub sub-issue on a repository. @@ -46,7 +46,7 @@ type SubIssueRequest struct { // Remove a sub-issue from the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#remove-sub-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { @@ -57,8 +57,8 @@ func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueN return nil, nil, err } - si := new(SubIssue) - resp, err := s.client.Do(ctx, req, si) + var si *SubIssue + resp, err := s.client.Do(ctx, req, &si) if err != nil { return nil, resp, err } @@ -68,10 +68,10 @@ func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueN // ListByIssue lists all sub-issues for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#list-sub-issues +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#list-sub-issues // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues -func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, issueNumber int64, opts *IssueListOptions) ([]*SubIssue, *Response, error) { +func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, issueNumber int64, opts *ListOptions) ([]*SubIssue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) u, err := addOptions(u, opts) if err != nil { @@ -97,7 +97,7 @@ func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, i // The sub-issue to be added must belong to the same repository owner as the parent issue. // To replace the existing parent of a sub-issue, set replaceParent to true. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#add-sub-issue +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#add-sub-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { @@ -107,8 +107,8 @@ func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumb return nil, nil, err } - si := new(SubIssue) - resp, err := s.client.Do(ctx, req, si) + var si *SubIssue + resp, err := s.client.Do(ctx, req, &si) if err != nil { return nil, resp, err } @@ -120,7 +120,7 @@ func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumb // // Either afterId or beforeId must be specified to determine the new position of the sub-issue. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#reprioritize-sub-issue // //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { @@ -130,8 +130,8 @@ func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, return nil, nil, err } - si := new(SubIssue) - resp, err := s.client.Do(ctx, req, si) + var si *SubIssue + resp, err := s.client.Do(ctx, req, &si) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/teams.go b/vendor/github.com/google/go-github/v85/github/teams.go similarity index 88% rename from vendor/github.com/google/go-github/v82/github/teams.go rename to vendor/github.com/google/go-github/v85/github/teams.go index e4d7e9c4a..3346f9a30 100644 --- a/vendor/github.com/google/go-github/v82/github/teams.go +++ b/vendor/github.com/google/go-github/v85/github/teams.go @@ -14,7 +14,7 @@ import ( // TeamsService provides access to the team-related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/teams/ +// GitHub API docs: https://docs.github.com/rest/teams?apiVersion=2022-11-28 type TeamsService service // Team represents a team within a GitHub organization. Teams are used to @@ -60,6 +60,10 @@ type Team struct { // possible values are: "direct", "indirect", "mixed". This is only populated when // calling the ListTeamsAssignedToOrgRole method. Assignment *string `json:"assignment,omitempty"` + + // Type identifies the ownership type of the team + // Possible values are: "organization", "enterprise". + Type *string `json:"type,omitempty"` } func (t Team) String() string { @@ -88,7 +92,7 @@ func (i Invitation) String() string { // ListTeams lists all of the teams for an organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-teams // //meta:operation GET /orgs/{org}/teams func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) { @@ -116,7 +120,7 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // // Deprecated: Use GetTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#get-a-team-by-name // //meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) { @@ -126,8 +130,8 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -137,7 +141,7 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T // GetTeamBySlug fetches a team, given a specified organization name, by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#get-a-team-by-name // //meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) { @@ -147,8 +151,8 @@ func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Te return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -192,7 +196,7 @@ func (s NewTeam) String() string { // CreateTeam creates a new team within an organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#create-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#create-a-team // //meta:operation POST /orgs/{org}/teams func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { @@ -202,8 +206,8 @@ func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -244,7 +248,7 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // // Deprecated: Use EditTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#update-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) { @@ -262,8 +266,8 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -273,7 +277,7 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te // EditTeamBySlug edits a team, given an organization name, by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#update-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) { @@ -291,8 +295,8 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -304,7 +308,7 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // // Deprecated: Use DeleteTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#delete-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) { @@ -319,7 +323,7 @@ func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) // DeleteTeamBySlug deletes a team reference by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#delete-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) { @@ -336,7 +340,7 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // // Deprecated: Use ListChildTeamsByParentSlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-child-teams // //meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) { @@ -362,7 +366,7 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team // ListChildTeamsByParentSlug lists child teams for a parent team given parent slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-child-teams // //meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) { @@ -390,7 +394,7 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // // Deprecated: Use ListTeamReposBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-team-repositories // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) { @@ -418,7 +422,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 // ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-team-repositories // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) { @@ -450,7 +454,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // // Deprecated: Use IsTeamRepoBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) { @@ -462,8 +466,8 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, req.Header.Set("Accept", mediaTypeOrgPermissionRepo) - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(ctx, req, &repository) if err != nil { return nil, resp, err } @@ -475,7 +479,7 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) { @@ -487,8 +491,8 @@ func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, r req.Header.Set("Accept", mediaTypeOrgPermissionRepo) - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(ctx, req, &repository) if err != nil { return nil, resp, err } @@ -517,7 +521,7 @@ type TeamAddTeamRepoOptions struct { // // Deprecated: Use AddTeamRepoBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { @@ -534,7 +538,7 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { @@ -553,7 +557,7 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // // Deprecated: Use RemoveTeamRepoBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#remove-a-repository-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { @@ -570,7 +574,7 @@ func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#remove-a-repository-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { @@ -585,7 +589,7 @@ func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owne // ListUserTeams lists a user's teams // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-teams-for-the-authenticated-user // //meta:operation GET /user/teams func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) { @@ -676,7 +680,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &ProjectV2{} + var projects *ProjectV2 resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -700,7 +704,7 @@ func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug s req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &ProjectV2{} + var projects *ProjectV2 resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -829,7 +833,7 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#list-idp-groups-for-an-organization // //meta:operation GET /orgs/{org}/team-sync/groups func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListIDPGroupsOptions) (*IDPGroupList, *Response, error) { @@ -844,8 +848,8 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err } @@ -858,7 +862,7 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // // Deprecated: Use ListIDPGroupsForTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#list-idp-groups-for-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { @@ -869,8 +873,8 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err } @@ -881,7 +885,7 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub // given organization name and team slug. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#list-idp-groups-for-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { @@ -892,8 +896,8 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err } @@ -906,7 +910,7 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // // Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#create-or-update-idp-group-connections // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { @@ -917,8 +921,8 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err } @@ -929,7 +933,7 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection // between a team and an IDP group given organization name and team slug. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#create-or-update-idp-group-connections // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { @@ -940,8 +944,8 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Conte return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(ctx, req, &groups) if err != nil { return nil, resp, err } @@ -979,7 +983,7 @@ type ExternalGroupList struct { // GetExternalGroup fetches an external group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#get-an-external-group // //meta:operation GET /orgs/{org}/external-group/{group_id} func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { @@ -989,8 +993,8 @@ func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID return nil, nil, err } - externalGroup := new(ExternalGroup) - resp, err := s.client.Do(ctx, req, externalGroup) + var externalGroup *ExternalGroup + resp, err := s.client.Do(ctx, req, &externalGroup) if err != nil { return nil, resp, err } @@ -1008,7 +1012,7 @@ type ListExternalGroupsOptions struct { // ListExternalGroups lists external groups in an organization on GitHub. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-available-to-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#list-external-groups-available-to-an-organization // //meta:operation GET /orgs/{org}/external-groups func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { @@ -1023,8 +1027,8 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts return nil, nil, err } - externalGroups := new(ExternalGroupList) - resp, err := s.client.Do(ctx, req, externalGroups) + var externalGroups *ExternalGroupList + resp, err := s.client.Do(ctx, req, &externalGroups) if err != nil { return nil, resp, err } @@ -1034,7 +1038,7 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts // ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#list-a-connection-between-an-external-group-and-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) { @@ -1045,8 +1049,8 @@ func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, return nil, nil, err } - externalGroups := new(ExternalGroupList) - resp, err := s.client.Do(ctx, req, externalGroups) + var externalGroups *ExternalGroupList + resp, err := s.client.Do(ctx, req, &externalGroups) if err != nil { return nil, resp, err } @@ -1056,7 +1060,7 @@ func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, // UpdateConnectedExternalGroup updates the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#update-the-connection-between-an-external-group-and-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { @@ -1067,8 +1071,8 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl return nil, nil, err } - externalGroup := new(ExternalGroup) - resp, err := s.client.Do(ctx, req, externalGroup) + var externalGroup *ExternalGroup + resp, err := s.client.Do(ctx, req, &externalGroup) if err != nil { return nil, resp, err } @@ -1078,7 +1082,7 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl // RemoveConnectedExternalGroup removes the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#remove-the-connection-between-an-external-group-and-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v85/github/teams_discussion_comments.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v85/github/teams_discussion_comments.go index 0080dac18..ae4781420 100644 --- a/vendor/github.com/google/go-github/v82/github/teams_discussion_comments.go +++ b/vendor/github.com/google/go-github/v85/github/teams_discussion_comments.go @@ -107,8 +107,8 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(ctx, req, &discussionComment) if err != nil { return nil, resp, err } @@ -130,8 +130,8 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(ctx, req, &discussionComment) if err != nil { return nil, resp, err } @@ -152,8 +152,8 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(ctx, req, &discussionComment) if err != nil { return nil, resp, err } @@ -174,8 +174,8 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(ctx, req, &discussionComment) if err != nil { return nil, resp, err } @@ -197,8 +197,8 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(ctx, req, &discussionComment) if err != nil { return nil, resp, err } @@ -220,8 +220,8 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(ctx, req, &discussionComment) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/teams_discussions.go b/vendor/github.com/google/go-github/v85/github/teams_discussions.go similarity index 94% rename from vendor/github.com/google/go-github/v82/github/teams_discussions.go rename to vendor/github.com/google/go-github/v85/github/teams_discussions.go index a06adecf5..f1fb51f00 100644 --- a/vendor/github.com/google/go-github/v82/github/teams_discussions.go +++ b/vendor/github.com/google/go-github/v85/github/teams_discussions.go @@ -113,8 +113,8 @@ func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int6 return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -135,8 +135,8 @@ func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -157,8 +157,8 @@ func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID i return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -179,8 +179,8 @@ func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug str return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -202,8 +202,8 @@ func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -225,8 +225,8 @@ func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug strin return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(ctx, req, &teamDiscussion) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v82/github/teams_members.go b/vendor/github.com/google/go-github/v85/github/teams_members.go similarity index 84% rename from vendor/github.com/google/go-github/v82/github/teams_members.go rename to vendor/github.com/google/go-github/v85/github/teams_members.go index 059d993a3..14842632e 100644 --- a/vendor/github.com/google/go-github/v82/github/teams_members.go +++ b/vendor/github.com/google/go-github/v85/github/teams_members.go @@ -23,7 +23,7 @@ type TeamListTeamMembersOptions struct { // ListTeamMembersByID lists all of the users who are members of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-team-members // //meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { @@ -50,7 +50,7 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in // ListTeamMembersBySlug lists all of the users who are members of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-team-members // //meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { @@ -77,7 +77,7 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri // GetTeamMembershipByID returns the membership status for a user in a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-team-members // //meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { @@ -87,8 +87,8 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -99,7 +99,7 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID // GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#get-team-membership-for-a-user // //meta:operation GET /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { @@ -109,8 +109,8 @@ func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, u return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -135,7 +135,7 @@ type TeamAddTeamMembershipOptions struct { // AddTeamMembershipByID adds or invites a user to a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#add-or-update-team-membership-for-a-user // //meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { @@ -145,8 +145,8 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -157,7 +157,7 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID // AddTeamMembershipBySlug adds or invites a user to a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#add-or-update-team-membership-for-a-user // //meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { @@ -167,8 +167,8 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(ctx, req, &t) if err != nil { return nil, resp, err } @@ -179,7 +179,7 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u // RemoveTeamMembershipByID removes a user from a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#remove-team-membership-for-a-user // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { @@ -195,7 +195,7 @@ func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, team // RemoveTeamMembershipBySlug removes a user from a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#remove-team-membership-for-a-user // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { @@ -211,7 +211,7 @@ func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug // ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-pending-team-invitations // //meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { @@ -238,7 +238,7 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID // ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-pending-team-invitations // //meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/timestamp.go b/vendor/github.com/google/go-github/v85/github/timestamp.go similarity index 99% rename from vendor/github.com/google/go-github/v82/github/timestamp.go rename to vendor/github.com/google/go-github/v85/github/timestamp.go index 71660193b..a26077da2 100644 --- a/vendor/github.com/google/go-github/v82/github/timestamp.go +++ b/vendor/github.com/google/go-github/v85/github/timestamp.go @@ -43,7 +43,7 @@ func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { } else { t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str) } - return + return err } // Equal reports whether t and u are equal based on time.Equal. diff --git a/vendor/github.com/google/go-github/v82/github/users.go b/vendor/github.com/google/go-github/v85/github/users.go similarity index 83% rename from vendor/github.com/google/go-github/v82/github/users.go rename to vendor/github.com/google/go-github/v85/github/users.go index b3bd3b09b..9daab2d0a 100644 --- a/vendor/github.com/google/go-github/v82/github/users.go +++ b/vendor/github.com/google/go-github/v85/github/users.go @@ -13,13 +13,14 @@ import ( // UsersService handles communication with the user related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/users/ +// GitHub API docs: https://docs.github.com/rest/users?apiVersion=2022-11-28 type UsersService service // User represents a GitHub user. type User struct { Login *string `json:"login,omitempty"` ID *int64 `json:"id,omitempty"` + UserViewType *string `json:"user_view_type,omitempty"` NodeID *string `json:"node_id,omitempty"` AvatarURL *string `json:"avatar_url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` @@ -29,6 +30,7 @@ type User struct { Blog *string `json:"blog,omitempty"` Location *string `json:"location,omitempty"` Email *string `json:"email,omitempty"` + NotificationEmail *string `json:"notification_email,omitempty"` Hireable *bool `json:"hireable,omitempty"` Bio *string `json:"bio,omitempty"` TwitterUsername *string `json:"twitter_username,omitempty"` @@ -48,6 +50,7 @@ type User struct { Collaborators *int `json:"collaborators,omitempty"` TwoFactorAuthentication *bool `json:"two_factor_authentication,omitempty"` Plan *Plan `json:"plan,omitempty"` + BusinessPlus *bool `json:"business_plus,omitempty"` LdapDn *string `json:"ldap_dn,omitempty"` // API URLs @@ -63,13 +66,13 @@ type User struct { SubscriptionsURL *string `json:"subscriptions_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search?apiVersion=2022-11-28#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Permissions and RoleName identify the permissions and role that a user has on a given // repository. These are only populated when calling Repositories.ListCollaborators. - Permissions map[string]bool `json:"permissions,omitempty"` - RoleName *string `json:"role_name,omitempty"` + Permissions *RepositoryPermissions `json:"permissions,omitempty"` + RoleName *string `json:"role_name,omitempty"` // Assignment identifies how a user was assigned to an organization role. Its // possible values are: "direct", "indirect", "mixed". This is only populated when @@ -87,9 +90,9 @@ func (u User) String() string { // Get fetches a user. Passing the empty string will fetch the authenticated // user. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-a-user // -// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user // //meta:operation GET /user //meta:operation GET /users/{username} @@ -105,8 +108,8 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, return nil, nil, err } - uResp := new(User) - resp, err := s.client.Do(ctx, req, uResp) + var uResp *User + resp, err := s.client.Do(ctx, req, &uResp) if err != nil { return nil, resp, err } @@ -116,7 +119,7 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user-using-their-id +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-a-user-using-their-id // //meta:operation GET /user/{account_id} func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) { @@ -126,8 +129,8 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, return nil, nil, err } - user := new(User) - resp, err := s.client.Do(ctx, req, user) + var user *User + resp, err := s.client.Do(ctx, req, &user) if err != nil { return nil, resp, err } @@ -137,7 +140,7 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, // Edit the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/users#update-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#update-the-authenticated-user // //meta:operation PATCH /user func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) { @@ -147,8 +150,8 @@ func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, return nil, nil, err } - uResp := new(User) - resp, err := s.client.Do(ctx, req, uResp) + var uResp *User + resp, err := s.client.Do(ctx, req, &uResp) if err != nil { return nil, resp, err } @@ -181,7 +184,7 @@ type UserContext struct { // GetHovercard fetches contextual information about user. It requires authentication // via Basic Auth or via OAuth with the repo scope. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-contextual-information-for-a-user // //meta:operation GET /users/{username}/hovercard func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) { @@ -196,8 +199,8 @@ func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *Hove return nil, nil, err } - hc := new(Hovercard) - resp, err := s.client.Do(ctx, req, hc) + var hc *Hovercard + resp, err := s.client.Do(ctx, req, &hc) if err != nil { return nil, resp, err } @@ -208,20 +211,16 @@ func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *Hove // UserListOptions specifies optional parameters to the UsersService.ListAll // method. type UserListOptions struct { - // ID of the last user seen - Since int64 `url:"since,omitempty"` - - // Note: Pagination is powered exclusively by the Since parameter, - // ListOptions.Page has no effect. - // ListOptions.PerPage controls an undocumented GitHub API parameter. - ListOptions + // A user ID. Only return users with an ID greater than this ID. + Since int64 `url:"since,omitempty"` + PerPage int `url:"per_page,omitempty"` } // ListAll lists all GitHub users. // // To paginate through all users, populate 'Since' with the ID of the last user. // -// GitHub API docs: https://docs.github.com/rest/users/users#list-users +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#list-users // //meta:operation GET /users func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) { @@ -247,7 +246,7 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U // ListInvitations lists all currently-open repository invitations for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#list-repository-invitations-for-the-authenticated-user // //meta:operation GET /user/repository_invitations func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { @@ -273,7 +272,7 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( // AcceptInvitation accepts the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#accept-a-repository-invitation // //meta:operation PATCH /user/repository_invitations/{invitation_id} func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) { @@ -289,7 +288,7 @@ func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) // DeclineInvitation declines the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#decline-a-repository-invitation // //meta:operation DELETE /user/repository_invitations/{invitation_id} func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_administration.go b/vendor/github.com/google/go-github/v85/github/users_administration.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/users_administration.go rename to vendor/github.com/google/go-github/v85/github/users_administration.go index 0a6d6c785..83da04ece 100644 --- a/vendor/github.com/google/go-github/v82/github/users_administration.go +++ b/vendor/github.com/google/go-github/v85/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_attestations.go b/vendor/github.com/google/go-github/v85/github/users_attestations.go similarity index 96% rename from vendor/github.com/google/go-github/v82/github/users_attestations.go rename to vendor/github.com/google/go-github/v85/github/users_attestations.go index d63634500..1070de8a2 100644 --- a/vendor/github.com/google/go-github/v82/github/users_attestations.go +++ b/vendor/github.com/google/go-github/v85/github/users_attestations.go @@ -14,7 +14,7 @@ import ( // with a given subject digest that are associated with repositories // owned by a user. // -// GitHub API docs: https://docs.github.com/rest/users/attestations#list-attestations +// GitHub API docs: https://docs.github.com/rest/users/attestations?apiVersion=2022-11-28#list-attestations // //meta:operation GET /users/{username}/attestations/{subject_digest} func (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_blocking.go b/vendor/github.com/google/go-github/v85/github/users_blocking.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/users_blocking.go rename to vendor/github.com/google/go-github/v85/github/users_blocking.go index 39d89d34c..25ae86c65 100644 --- a/vendor/github.com/google/go-github/v82/github/users_blocking.go +++ b/vendor/github.com/google/go-github/v85/github/users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the blocked users by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#list-users-blocked-by-the-authenticated-user // //meta:operation GET /user/blocks func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) { @@ -40,7 +40,7 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) // IsBlocked reports whether specified user is blocked by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#check-if-a-user-is-blocked-by-the-authenticated-user // //meta:operation GET /user/blocks/{username} func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) { @@ -60,7 +60,7 @@ func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Respo // BlockUser blocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#block-a-user // //meta:operation PUT /user/blocks/{username} func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) { @@ -78,7 +78,7 @@ func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, e // UnblockUser unblocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#unblock-a-user // //meta:operation DELETE /user/blocks/{username} func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_emails.go b/vendor/github.com/google/go-github/v85/github/users_emails.go similarity index 82% rename from vendor/github.com/google/go-github/v82/github/users_emails.go rename to vendor/github.com/google/go-github/v85/github/users_emails.go index 3d0e1bfaa..ad98fa4b6 100644 --- a/vendor/github.com/google/go-github/v82/github/users_emails.go +++ b/vendor/github.com/google/go-github/v85/github/users_emails.go @@ -17,7 +17,7 @@ type UserEmail struct { // ListEmails lists all email addresses for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#list-email-addresses-for-the-authenticated-user // //meta:operation GET /user/emails func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) { @@ -43,7 +43,7 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us // AddEmails adds email addresses of the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#add-an-email-address-for-the-authenticated-user // //meta:operation POST /user/emails func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) { @@ -64,7 +64,7 @@ func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserE // DeleteEmails deletes email addresses from authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#delete-an-email-address-for-the-authenticated-user // //meta:operation DELETE /user/emails func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) { @@ -80,7 +80,7 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp // SetEmailVisibility sets the visibility for the primary email address of the authenticated user. // `visibility` can be "private" or "public". // -// GitHub API docs: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#set-primary-email-visibility-for-the-authenticated-user // //meta:operation PATCH /user/email/visibility func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_followers.go b/vendor/github.com/google/go-github/v85/github/users_followers.go similarity index 89% rename from vendor/github.com/google/go-github/v82/github/users_followers.go rename to vendor/github.com/google/go-github/v85/github/users_followers.go index 6833d8df6..8a9402403 100644 --- a/vendor/github.com/google/go-github/v82/github/users_followers.go +++ b/vendor/github.com/google/go-github/v85/github/users_followers.go @@ -13,9 +13,9 @@ import ( // ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-followers-of-a-user // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-followers-of-the-authenticated-user // //meta:operation GET /user/followers //meta:operation GET /users/{username}/followers @@ -48,9 +48,9 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-the-people-a-user-follows // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-the-people-the-authenticated-user-follows // //meta:operation GET /user/following //meta:operation GET /users/{username}/following @@ -83,9 +83,9 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // -// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#check-if-a-person-is-followed-by-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#check-if-a-user-follows-another-user // //meta:operation GET /user/following/{username} //meta:operation GET /users/{username}/following/{target_user} @@ -109,7 +109,7 @@ func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bo // Follow will cause the authenticated user to follow the specified user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#follow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#follow-a-user // //meta:operation PUT /user/following/{username} func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) { @@ -124,7 +124,7 @@ func (s *UsersService) Follow(ctx context.Context, user string) (*Response, erro // Unfollow will cause the authenticated user to unfollow the specified user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#unfollow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#unfollow-a-user // //meta:operation DELETE /user/following/{username} func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v85/github/users_gpg_keys.go similarity index 83% rename from vendor/github.com/google/go-github/v82/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v85/github/users_gpg_keys.go index d33564cab..678d6c732 100644 --- a/vendor/github.com/google/go-github/v82/github/users_gpg_keys.go +++ b/vendor/github.com/google/go-github/v85/github/users_gpg_keys.go @@ -44,9 +44,9 @@ type GPGEmail struct { // string will fetch keys for the authenticated user. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#list-gpg-keys-for-a-user // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#list-gpg-keys-for-the-authenticated-user // //meta:operation GET /user/gpg_keys //meta:operation GET /users/{username}/gpg_keys @@ -79,7 +79,7 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO // GetGPGKey gets extended details for a single GPG key. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#get-a-gpg-key-for-the-authenticated-user // //meta:operation GET /user/gpg_keys/{gpg_key_id} func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) { @@ -89,8 +89,8 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo return nil, nil, err } - key := &GPGKey{} - resp, err := s.client.Do(ctx, req, key) + var key *GPGKey + resp, err := s.client.Do(ctx, req, &key) if err != nil { return nil, resp, err } @@ -101,7 +101,7 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // CreateGPGKey creates a GPG key. It requires authentication via Basic Auth // or OAuth with at least write:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#create-a-gpg-key-for-the-authenticated-user // //meta:operation POST /user/gpg_keys func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { @@ -113,8 +113,8 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string return nil, nil, err } - key := &GPGKey{} - resp, err := s.client.Do(ctx, req, key) + var key *GPGKey + resp, err := s.client.Do(ctx, req, &key) if err != nil { return nil, resp, err } @@ -125,7 +125,7 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or // via OAuth with at least admin:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#delete-a-gpg-key-for-the-authenticated-user // //meta:operation DELETE /user/gpg_keys/{gpg_key_id} func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_keys.go b/vendor/github.com/google/go-github/v85/github/users_keys.go similarity index 77% rename from vendor/github.com/google/go-github/v82/github/users_keys.go rename to vendor/github.com/google/go-github/v85/github/users_keys.go index 350a684b7..4e0ca7f86 100644 --- a/vendor/github.com/google/go-github/v82/github/users_keys.go +++ b/vendor/github.com/google/go-github/v85/github/users_keys.go @@ -30,9 +30,9 @@ func (k Key) String() string { // ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#list-public-keys-for-a-user // -// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#list-public-ssh-keys-for-the-authenticated-user // //meta:operation GET /user/keys //meta:operation GET /users/{username}/keys @@ -64,7 +64,7 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti // GetKey fetches a single public key. // -// GitHub API docs: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#get-a-public-ssh-key-for-the-authenticated-user // //meta:operation GET /user/keys/{key_id} func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) { @@ -75,8 +75,8 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e return nil, nil, err } - key := new(Key) - resp, err := s.client.Do(ctx, req, key) + var key *Key + resp, err := s.client.Do(ctx, req, &key) if err != nil { return nil, resp, err } @@ -86,7 +86,7 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e // CreateKey adds a public key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#create-a-public-ssh-key-for-the-authenticated-user // //meta:operation POST /user/keys func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) { @@ -97,8 +97,8 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response return nil, nil, err } - k := new(Key) - resp, err := s.client.Do(ctx, req, k) + var k *Key + resp, err := s.client.Do(ctx, req, &k) if err != nil { return nil, resp, err } @@ -108,7 +108,7 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response // DeleteKey deletes a public key. // -// GitHub API docs: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#delete-a-public-ssh-key-for-the-authenticated-user // //meta:operation DELETE /user/keys/{key_id} func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_packages.go b/vendor/github.com/google/go-github/v85/github/users_packages.go similarity index 78% rename from vendor/github.com/google/go-github/v82/github/users_packages.go rename to vendor/github.com/google/go-github/v85/github/users_packages.go index fa6cd9157..b9bf563de 100644 --- a/vendor/github.com/google/go-github/v82/github/users_packages.go +++ b/vendor/github.com/google/go-github/v85/github/users_packages.go @@ -14,9 +14,9 @@ import ( // ListPackages lists the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-packages-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-packages-for-the-authenticated-users-namespace // //meta:operation GET /user/packages //meta:operation GET /users/{username}/packages @@ -49,9 +49,9 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // GetPackage gets a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-for-the-authenticated-user // //meta:operation GET /user/packages/{package_type}/{package_name} //meta:operation GET /users/{username}/packages/{package_type}/{package_name} @@ -80,9 +80,9 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // DeletePackage deletes a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-for-the-authenticated-user // //meta:operation DELETE /user/packages/{package_type}/{package_name} //meta:operation DELETE /users/{username}/packages/{package_type}/{package_name} @@ -105,9 +105,9 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // RestorePackage restores a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-for-the-authenticated-user // //meta:operation POST /user/packages/{package_type}/{package_name}/restore //meta:operation POST /users/{username}/packages/{package_type}/{package_name}/restore @@ -127,22 +127,21 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa return s.client.Do(ctx, req, nil) } -// PackageGetAllVersions gets all versions of a package for a user. Passing the empty string for "user" will -// get versions for the authenticated user. -// -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user +// ListPackageVersionsOptions specifies the optional parameters to the UsersService.ListPackageVersions. +type ListPackageVersionsOptions struct { + // State of package either "active" or "deleted". + State string `url:"state,omitempty"` + + ListOptions +} + +// ListPackageVersions gets all versions of a package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-the-authenticated-user // //meta:operation GET /user/packages/{package_type}/{package_name}/versions -//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions -func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { - var u string - if user != "" { - u = fmt.Sprintf("users/%v/packages/%v/%v/versions", user, packageType, packageName) - } else { - u = fmt.Sprintf("user/packages/%v/%v/versions", packageType, packageName) - } +func (s *UsersService) ListPackageVersions(ctx context.Context, packageType, packageName string, opts *ListPackageVersionsOptions) ([]*PackageVersion, *Response, error) { + u := fmt.Sprintf("user/packages/%v/%v/versions", packageType, packageName) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -162,12 +161,34 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT return versions, resp, nil } +// ListUserPackageVersions returns package versions for a public package owned by a specified user. +// +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-a-user +// +//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions +func (s *UsersService) ListUserPackageVersions(ctx context.Context, user, packageType, packageName string) ([]*PackageVersion, *Response, error) { + u := fmt.Sprintf("users/%v/packages/%v/%v/versions", user, packageType, packageName) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var versions []*PackageVersion + resp, err := s.client.Do(ctx, req, &versions) + if err != nil { + return nil, resp, err + } + + return versions, resp, nil +} + // PackageGetVersion gets a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-version-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-version-for-the-authenticated-user // //meta:operation GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} //meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} @@ -196,9 +217,9 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // PackageDeleteVersion deletes a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-version-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-package-version-for-a-user // //meta:operation DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} //meta:operation DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} @@ -221,9 +242,9 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // PackageRestoreVersion restores a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-version-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-package-version-for-a-user // //meta:operation POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore //meta:operation POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore diff --git a/vendor/github.com/google/go-github/v82/github/users_social_accounts.go b/vendor/github.com/google/go-github/v85/github/users_social_accounts.go similarity index 91% rename from vendor/github.com/google/go-github/v82/github/users_social_accounts.go rename to vendor/github.com/google/go-github/v85/github/users_social_accounts.go index e7642c6d6..958e1e64d 100644 --- a/vendor/github.com/google/go-github/v82/github/users_social_accounts.go +++ b/vendor/github.com/google/go-github/v85/github/users_social_accounts.go @@ -23,7 +23,7 @@ type socialAccountsRequest struct { // ListSocialAccounts lists all social accounts for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#list-social-accounts-for-the-authenticated-user // //meta:operation GET /user/social_accounts func (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions) ([]*SocialAccount, *Response, error) { @@ -49,7 +49,7 @@ func (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions // AddSocialAccounts adds social accounts for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#add-social-accounts-for-the-authenticated-user // //meta:operation POST /user/social_accounts func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []string) ([]*SocialAccount, *Response, error) { @@ -70,7 +70,7 @@ func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []stri // DeleteSocialAccounts deletes social accounts for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#delete-social-accounts-for-the-authenticated-user // //meta:operation DELETE /user/social_accounts func (s *UsersService) DeleteSocialAccounts(ctx context.Context, accountURLs []string) (*Response, error) { @@ -85,7 +85,7 @@ func (s *UsersService) DeleteSocialAccounts(ctx context.Context, accountURLs []s // ListUserSocialAccounts lists all social accounts for a user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#list-social-accounts-for-a-user // //meta:operation GET /users/{username}/social_accounts func (s *UsersService) ListUserSocialAccounts(ctx context.Context, username string, opts *ListOptions) ([]*SocialAccount, *Response, error) { diff --git a/vendor/github.com/google/go-github/v82/github/users_ssh_signing_keys.go b/vendor/github.com/google/go-github/v85/github/users_ssh_signing_keys.go similarity index 85% rename from vendor/github.com/google/go-github/v82/github/users_ssh_signing_keys.go rename to vendor/github.com/google/go-github/v85/github/users_ssh_signing_keys.go index 968401f02..78c556bfd 100644 --- a/vendor/github.com/google/go-github/v82/github/users_ssh_signing_keys.go +++ b/vendor/github.com/google/go-github/v85/github/users_ssh_signing_keys.go @@ -25,9 +25,9 @@ func (k SSHSigningKey) String() string { // ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty // username string will fetch SSH signing keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#list-ssh-signing-keys-for-a-user // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#list-ssh-signing-keys-for-the-authenticated-user // //meta:operation GET /user/ssh_signing_keys //meta:operation GET /users/{username}/ssh_signing_keys @@ -59,7 +59,7 @@ func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts // GetSSHSigningKey fetches a single SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#get-an-ssh-signing-key-for-the-authenticated-user // //meta:operation GET /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) { @@ -70,8 +70,8 @@ func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSign return nil, nil, err } - key := new(SSHSigningKey) - resp, err := s.client.Do(ctx, req, key) + var key *SSHSigningKey + resp, err := s.client.Do(ctx, req, &key) if err != nil { return nil, resp, err } @@ -81,7 +81,7 @@ func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSign // CreateSSHSigningKey adds a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#create-a-ssh-signing-key-for-the-authenticated-user // //meta:operation POST /user/ssh_signing_keys func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) { @@ -92,8 +92,8 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS return nil, nil, err } - k := new(SSHSigningKey) - resp, err := s.client.Do(ctx, req, k) + var k *SSHSigningKey + resp, err := s.client.Do(ctx, req, &k) if err != nil { return nil, resp, err } @@ -103,7 +103,7 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS // DeleteSSHSigningKey deletes a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#delete-an-ssh-signing-key-for-the-authenticated-user // //meta:operation DELETE /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { diff --git a/vendor/github.com/hairyhenderson/go-codeowners/.golangci.yml b/vendor/github.com/hairyhenderson/go-codeowners/.golangci.yml new file mode 100644 index 000000000..393d1c369 --- /dev/null +++ b/vendor/github.com/hairyhenderson/go-codeowners/.golangci.yml @@ -0,0 +1,66 @@ +linters-settings: + govet: + enable-all: true + gocyclo: + min-complexity: 10 + dupl: + threshold: 100 + goconst: + min-len: 2 + min-occurrences: 4 + lll: + line-length: 140 + nolintlint: + allow-unused: false # report any unused nolint directives + require-explanation: false # don't require an explanation for nolint directives + require-specific: false # don't require nolint directives to be specific about which linter is being skipped + +linters: + disable-all: true + enable: + - asciicheck + - bodyclose + - copyloopvar + # - dogsled + - dupl + - errcheck + - exhaustive + - funlen + - gci + - gochecknoglobals + - gochecknoinits + - gocognit + - goconst + - gocritic + - gocyclo + - godox + - gofmt + # - gofumpt + - goheader + - goimports + # - gomnd + - gomodguard + - goprintffuncname + - gosec + - gosimple + - govet + - ineffassign + - lll + - misspell + - nakedret + - nestif + # - nlreturn + - noctx + - nolintlint + - prealloc + - revive + - rowserrcheck + - sqlclosecheck + - staticcheck + - stylecheck + - typecheck + - unconvert + - unparam + - unused + - whitespace + # - wsl diff --git a/vendor/github.com/hairyhenderson/go-codeowners/.release-please-manifest.json b/vendor/github.com/hairyhenderson/go-codeowners/.release-please-manifest.json new file mode 100644 index 000000000..77c0d292c --- /dev/null +++ b/vendor/github.com/hairyhenderson/go-codeowners/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.7.0" +} diff --git a/vendor/github.com/hairyhenderson/go-codeowners/CHANGELOG.md b/vendor/github.com/hairyhenderson/go-codeowners/CHANGELOG.md new file mode 100644 index 000000000..ac35ef70c --- /dev/null +++ b/vendor/github.com/hairyhenderson/go-codeowners/CHANGELOG.md @@ -0,0 +1,33 @@ +# Changelog + +## [0.7.0](https://github.com/hairyhenderson/go-codeowners/compare/v0.6.1...v0.7.0) (2024-12-07) + + +### Features + +* add PatternIndex method ([#48](https://github.com/hairyhenderson/go-codeowners/issues/48)) ([a5c2e59](https://github.com/hairyhenderson/go-codeowners/commit/a5c2e593dcbe38fa52c24c95a72d1ca3f5e47ee8)) + + +### Dependencies + +* **go:** Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 ([#49](https://github.com/hairyhenderson/go-codeowners/issues/49)) ([4f55176](https://github.com/hairyhenderson/go-codeowners/commit/4f551769326fc31237d06b29a4a0497c78bd882f)) + +## [0.6.1](https://github.com/hairyhenderson/go-codeowners/compare/v0.6.0...v0.6.1) (2024-10-25) + + +### Bug Fixes + +* **parsing:** Check for CODEOWNERS files for both GitHub and GitLab ([#45](https://github.com/hairyhenderson/go-codeowners/issues/45)) ([db9c01e](https://github.com/hairyhenderson/go-codeowners/commit/db9c01eb61a0e5975521721a102e8c54b6dc2876)), closes [#44](https://github.com/hairyhenderson/go-codeowners/issues/44) +* **parsing:** Ignore block and inline comments ([#46](https://github.com/hairyhenderson/go-codeowners/issues/46)) ([968c9ea](https://github.com/hairyhenderson/go-codeowners/commit/968c9eaf0924c1912731d2729f26d2c691b8d4b1)) + +## [0.6.0](https://github.com/hairyhenderson/go-codeowners/compare/v0.5.0...v0.6.0) (2024-09-27) + + +### Features + +* **errors:** Allow checking codeowners file not found ([#41](https://github.com/hairyhenderson/go-codeowners/issues/41)) ([d659b73](https://github.com/hairyhenderson/go-codeowners/commit/d659b73a08c1a1111c5e9c4c1136472c8ca28a4b)) + + +### Bug Fixes + +* **perf:** Reduce allocations ([#39](https://github.com/hairyhenderson/go-codeowners/issues/39)) ([2ca66e0](https://github.com/hairyhenderson/go-codeowners/commit/2ca66e0194d2b9077c63a9d1eace8f1083675fa9)) diff --git a/vendor/github.com/hairyhenderson/go-codeowners/LICENSE b/vendor/github.com/hairyhenderson/go-codeowners/LICENSE new file mode 100644 index 000000000..80265d0a2 --- /dev/null +++ b/vendor/github.com/hairyhenderson/go-codeowners/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-2024 Dave Henderson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/hairyhenderson/go-codeowners/README.md b/vendor/github.com/hairyhenderson/go-codeowners/README.md new file mode 100644 index 000000000..798a3ba30 --- /dev/null +++ b/vendor/github.com/hairyhenderson/go-codeowners/README.md @@ -0,0 +1,48 @@ +[![Go Reference][doc-image]][docs] +[![Build][build-image]][build-url] + +# go-codeowners + +A package that finds and parses [`CODEOWNERS`](https://help.github.com/articles/about-codeowners/) files. + +Features: +- operates on local repos +- doesn't require a cloned repo (i.e. doesn't need a `.git` directory to be + present at the repo's root) +- can be called from within a repo (doesn't have to be at the root) +- will find `CODEOWNERS` files in all documented locations: the repo's root, + `docs/`, and `.github/` (or `.gitlab/` for GitLab repos) + +## Usage + +```console +go get -u github.com/hairyhenderson/go-codeowners +``` + +To find the owner of the README.md file: + +```go +import "github.com/hairyhenderson/go-codeowners" + +func main() { + c, _ := FromFile(cwd()) + owners := c.Owners("README.md") + for i, o := range owners { + fmt.Printf("Owner #%d is %s\n", i, o) + } +} +``` + +See the [docs][] for more information. + +## License + +[The MIT License](http://opensource.org/licenses/MIT) + +Copyright (c) 2018-2023 Dave Henderson + +[docs]: https://pkg.go.dev/github.com/hairyhenderson/go-codeowners +[doc-image]: https://pkg.go.dev/badge/github.com/hairyhenderson/go-codeowners.svg + +[build-image]: https://github.com/hairyhenderson/go-codeowners/actions/workflows/build.yml/badge.svg +[build-url]: https://github.com/hairyhenderson/go-codeowners/actions/workflows/build.yml diff --git a/vendor/github.com/hairyhenderson/go-codeowners/codeowners.go b/vendor/github.com/hairyhenderson/go-codeowners/codeowners.go new file mode 100644 index 000000000..3a5c7b2f7 --- /dev/null +++ b/vendor/github.com/hairyhenderson/go-codeowners/codeowners.go @@ -0,0 +1,303 @@ +package codeowners + +import ( + "bufio" + "errors" + "fmt" + "io" + "io/fs" + "os" + "path" + "path/filepath" + "regexp" + "strings" +) + +// ErrNoCodeownersFound is returned when no CODEOWNERS file is found +var ErrNoCodeownersFound = errors.New("no CODEOWNERS found") + +// Codeowners - patterns/owners mappings for the given repo +type Codeowners struct { + repoRoot string + Patterns []Codeowner +} + +// Codeowner - owners for a given pattern +type Codeowner struct { + Pattern string + re *regexp.Regexp + Owners []string +} + +func (c Codeowner) String() string { + return fmt.Sprintf("%s\t%v", c.Pattern, strings.Join(c.Owners, ", ")) +} + +func dirExists(fsys fs.FS, path string) (bool, error) { + fi, err := fs.Stat(fsys, path) + if err == nil && fi.IsDir() { + return true, nil + } + + if errors.Is(err, fs.ErrNotExist) { + return false, nil + } + + return false, err +} + +// findCodeownersFile - find a CODEOWNERS file somewhere within or below +// the working directory (wd), and open it. +func findCodeownersFile(fsys fs.FS, wd string) (io.Reader, string, error) { + dir := wd + for { + for _, p := range []string{".github", ".", "docs", ".gitlab"} { + pth := path.Join(dir, p) + exists, err := dirExists(fsys, pth) + if err != nil { + return nil, "", err + } + if exists { + f := path.Join(pth, "CODEOWNERS") + _, err := fs.Stat(fsys, f) + if err != nil { + if errors.Is(err, fs.ErrNotExist) { + continue + } + return nil, "", err + } + r, err := fsys.Open(f) + return r, dir, err + } + } + odir := dir + dir = path.Dir(odir) + // if we can't go up any further... + if odir == dir { + break + } + // if we're heading above the volume name (relevant on Windows)... + if len(dir) < len(filepath.VolumeName(odir)) { + break + } + } + return nil, "", nil +} + +// Deprecated: Use [FromFile] instead. +func NewCodeowners(path string) (*Codeowners, error) { + return FromFile(path) +} + +// FromFile creates a Codeowners from the path to a local file. Consider using +// [FromFileWithFS] instead. +func FromFile(path string) (*Codeowners, error) { + base := "/" + if filepath.IsAbs(path) && filepath.VolumeName(path) != "" { + base = path[:len(filepath.VolumeName(path))+1] + } + path = path[len(base):] + + return FromFileWithFS(os.DirFS(base), path) +} + +// FromFileWithFS creates a Codeowners from the path to a file relative to the +// given filesystem. +func FromFileWithFS(fsys fs.FS, path string) (*Codeowners, error) { + r, root, err := findCodeownersFile(fsys, path) + if err != nil { + return nil, err + } + if r == nil { + return nil, fmt.Errorf("%w in %s", ErrNoCodeownersFound, path) + } + return FromReader(r, root) +} + +// FromReader creates a Codeowners from a given Reader instance and root path. +func FromReader(r io.Reader, repoRoot string) (*Codeowners, error) { + co := &Codeowners{ + repoRoot: repoRoot, + } + patterns, err := parseCodeowners(r) + if err != nil { + return nil, err + } + co.Patterns = patterns + return co, nil +} + +func isSection(line string) bool { + return strings.HasPrefix(line, "^") || strings.HasPrefix(line, "[") +} + +// parseCodeowners parses a list of Codeowners from a Reader +func parseCodeowners(r io.Reader) ([]Codeowner, error) { + co := []Codeowner{} + s := bufio.NewScanner(r) + var defaultOwners []string + for s.Scan() { + line := s.Text() + if isSection(line) { + defaultOwners = parseDefaultOwners(line) + continue + } + fields := strings.Fields(line) + + fields = removeComments(fields) + if len(fields) == 0 { + continue + } + if len(fields) > 1 { + fields = combineEscapedSpaces(fields) + c, err := NewCodeowner(fields[0], fields[1:]) + if err != nil { + return nil, err + } + co = append(co, c) + } else if len(fields) == 1 && defaultOwners != nil { + c, err := NewCodeowner(fields[0], defaultOwners) + if err != nil { + return nil, err + } + co = append(co, c) + } + } + return co, nil +} + +func removeComments(fields []string) []string { + for i := range fields { + if strings.HasPrefix(fields[i], "#") { + fields = fields[:i] + break + } + } + return fields +} + +func parseDefaultOwners(line string) []string { + index := strings.LastIndex(line, "]") + if index != -1 && len(line) > index+1 { + return strings.Fields(strings.TrimSpace(line[index+1:])) + } + return nil +} + +// if any of the elements ends with a \, it was an escaped space +// put it back together properly so it's not treated as separate fields +func combineEscapedSpaces(fields []string) []string { + outFields := make([]string, 0) + escape := `\` + for i := 0; i < len(fields); i++ { + outField := fields[i] + for strings.HasSuffix(fields[i], escape) && i+1 < len(fields) { + outField = strings.Join([]string{strings.TrimRight(outField, escape), fields[i+1]}, " ") + i++ + } + outFields = append(outFields, outField) + } + + return outFields +} + +// NewCodeowner - +func NewCodeowner(pattern string, owners []string) (Codeowner, error) { + re, err := getPattern(pattern) + if err != nil { + return Codeowner{}, err + } + c := Codeowner{ + Pattern: pattern, + re: re, + Owners: owners, + } + return c, nil +} + +// Owners - return the list of code owners for the given path +// (within the repo root) +func (c *Codeowners) Owners(path string) []string { + if i := c.PatternIndex(path); i >= 0 { + return c.Patterns[i].Owners + } + return nil +} + +// PatternIndex - return the index of the pattern that matches the given path +// (within the repo root) +func (c *Codeowners) PatternIndex(path string) int { + if strings.HasPrefix(path, c.repoRoot) { + path = strings.Replace(path, c.repoRoot, "", 1) + } + + // Order is important; the last matching pattern takes the most precedence. + for i := len(c.Patterns) - 1; i >= 0; i-- { + if c.Patterns[i].re.MatchString(path) { + return i + } + } + + return -1 +} + +// precompile all regular expressions +var ( + rePrependSlash = regexp.MustCompile(`([^\/+])/.*\*\.`) +) + +// based on github.com/sabhiram/go-gitignore +// but modified so that 'dir/*' only matches files in 'dir/' +func getPattern(line string) (*regexp.Regexp, error) { + // when # or ! is escaped with a \ + if strings.HasPrefix(line, `\#`) || strings.HasPrefix(line, `\!`) { + line = line[1:] + } + + // If we encounter a foo/*.blah in a folder, prepend the / char + if rePrependSlash.MatchString(line) && line[0] != '/' { + line = "/" + line + } + + // Handle escaping the "." char + line = strings.ReplaceAll(line, ".", `\.`) + + magicStar := "#$~" + + // Handle "/**/" usage + if strings.HasPrefix(line, "/**/") { + line = line[1:] + } + line = strings.ReplaceAll(line, `/**/`, `(/|/.+/)`) + line = strings.ReplaceAll(line, `**/`, `(|.`+magicStar+`/)`) + line = strings.ReplaceAll(line, `/**`, `(|/.`+magicStar+`)`) + + // Handle escaping the "*" char + line = strings.ReplaceAll(line, `\*`, `\`+magicStar) + line = strings.ReplaceAll(line, `*`, `([^/]*)`) + + // Handle escaping the "?" char + line = strings.ReplaceAll(line, "?", `\?`) + + line = strings.ReplaceAll(line, magicStar, "*") + + // Temporary regex + expr := "" + + switch { + case strings.HasSuffix(line, "/"): + expr = line + "(|.*)$" + case strings.HasSuffix(line, "/([^/]*)"): + expr = line + "$" + default: + expr = line + "($|/.*$)" + } + + if strings.HasPrefix(expr, "/") { + expr = "^(|/)" + expr[1:] + } else { + expr = "^(|.*/)" + expr + } + + return regexp.Compile(expr) +} diff --git a/vendor/github.com/hairyhenderson/go-codeowners/release-please-config.json b/vendor/github.com/hairyhenderson/go-codeowners/release-please-config.json new file mode 100644 index 000000000..b803e3078 --- /dev/null +++ b/vendor/github.com/hairyhenderson/go-codeowners/release-please-config.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "go", + "changelog-type": "default", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "deps", + "section": "Dependencies" + }, + { + "type": "chore", + "section": "Miscellaneous Chores", + "hidden": true + }, + { + "type": "build", + "section": "Build System", + "hidden": true + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "packages": { + ".": {} + } +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go index 7402e0618..b24a2fadc 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -1,5 +1,5 @@ -//go:build (appengine || js || nacl || tinygo || wasm) && !windows -// +build appengine js nacl tinygo wasm +//go:build (appengine || js || nacl || tinygo || wasm || wasip1 || wasip2) && !windows +// +build appengine js nacl tinygo wasm wasip1 wasip2 // +build !windows package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go index 8e3c99171..5f29c11dd 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_windows.go +++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go @@ -31,6 +31,10 @@ func init() { if procGetFileInformationByHandleEx.Find() != nil { procGetFileInformationByHandleEx = nil } + // Check if NtQueryObject is available. + if procNtQueryObject.Find() != nil { + procNtQueryObject = nil + } } // IsTerminal return true if the file descriptor is terminal. @@ -43,6 +47,7 @@ func IsTerminal(fd uintptr) bool { // Check pipe name is used for cygwin/msys2 pty. // Cygwin/MSYS2 PTY has a name like: // \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master +// On Windows 7 a trailing suffix (e.g. "-nat") may be appended. func isCygwinPipeName(name string) bool { token := strings.Split(name, "-") if len(token) < 5 { @@ -72,13 +77,19 @@ func isCygwinPipeName(name string) bool { return false } + for _, t := range token[5:] { + if t == "" { + return false + } + } + return true } -// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler +// getFileNameByHandle use the undocumented ntdll NtQueryObject to get file full name from file handler // since GetFileInformationByHandleEx is not available under windows Vista and still some old fashion // guys are using Windows XP, this is a workaround for those guys, it will also work on system from -// Windows vista to 10 +// Windows Vista to 10 // see https://stackoverflow.com/a/18792477 for details func getFileNameByHandle(fd uintptr) (string, error) { if procNtQueryObject == nil { diff --git a/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/datadog/datadog.go b/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/datadog/datadog.go index cd996936c..bfd19ac40 100644 --- a/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/datadog/datadog.go +++ b/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/datadog/datadog.go @@ -116,7 +116,7 @@ func (e *Emitter) Emit(ctx context.Context, interval time.Duration) { } func (e *Emitter) EmitOnce() { - e.registry.Each(func(name string, metric interface{}) { + e.registry.Each(func(name string, metric any) { name, tags := tagsFromName(name) switch m := metric.(type) { diff --git a/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/prometheus/collector.go b/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/prometheus/collector.go index dd5f4a52a..c1ae63405 100644 --- a/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/prometheus/collector.go +++ b/vendor/github.com/palantir/go-baseapp/appmetrics/emitter/prometheus/collector.go @@ -181,8 +181,8 @@ func labelsFromName(name string) (string, prometheus.Labels) { return sanitizeName(name), labels } - labelPairs := strings.Split(name[start+1:len(name)-1], ",") - for _, pair := range labelPairs { + labelPairs := strings.SplitSeq(name[start+1:len(name)-1], ",") + for pair := range labelPairs { key, value, ok := strings.Cut(strings.TrimSpace(pair), ":") if ok { labels[sanitizeLabel(key)] = value diff --git a/vendor/github.com/palantir/go-baseapp/baseapp/error.go b/vendor/github.com/palantir/go-baseapp/baseapp/error.go index 2920053e8..0bfdc231e 100644 --- a/vendor/github.com/palantir/go-baseapp/baseapp/error.go +++ b/vendor/github.com/palantir/go-baseapp/baseapp/error.go @@ -32,7 +32,7 @@ type httpError interface { // RichErrorMarshalFunc is a zerolog error marshaller that formats the error as // a string that includes a stack trace, if one is available. -func RichErrorMarshalFunc(err error) interface{} { +func RichErrorMarshalFunc(err error) any { return errfmt.Print(err) } diff --git a/vendor/github.com/palantir/go-baseapp/baseapp/params.go b/vendor/github.com/palantir/go-baseapp/baseapp/params.go index b751daf42..9b66e809e 100644 --- a/vendor/github.com/palantir/go-baseapp/baseapp/params.go +++ b/vendor/github.com/palantir/go-baseapp/baseapp/params.go @@ -79,7 +79,7 @@ func WithUTCNanoTime() Param { } // WithErrorLogging sets a formatting function used to log errors. -func WithErrorLogging(marshalFunc func(err error) interface{}) Param { +func WithErrorLogging(marshalFunc func(err error) any) Param { return func(b *Server) error { zerolog.ErrorMarshalFunc = marshalFunc return nil diff --git a/vendor/github.com/palantir/go-baseapp/baseapp/server.go b/vendor/github.com/palantir/go-baseapp/baseapp/server.go index 5f24c1adc..e7b48cffd 100644 --- a/vendor/github.com/palantir/go-baseapp/baseapp/server.go +++ b/vendor/github.com/palantir/go-baseapp/baseapp/server.go @@ -187,7 +187,7 @@ func (s *Server) Start() error { } // WriteJSON writes a JSON response or an error if mashalling the object fails. -func WriteJSON(w http.ResponseWriter, status int, obj interface{}) { +func WriteJSON(w http.ResponseWriter, status int, obj any) { w.Header().Set("Content-Type", "application/json") b, err := json.Marshal(obj) diff --git a/vendor/github.com/palantir/go-baseapp/pkg/errfmt/errfmt.go b/vendor/github.com/palantir/go-baseapp/pkg/errfmt/errfmt.go index 1a6eab5e0..9fb739d2a 100644 --- a/vendor/github.com/palantir/go-baseapp/pkg/errfmt/errfmt.go +++ b/vendor/github.com/palantir/go-baseapp/pkg/errfmt/errfmt.go @@ -44,7 +44,7 @@ func Print(err error) string { return "" } - var deepestStack interface{} + var deepestStack any currErr := err for currErr != nil { switch currErr.(type) { @@ -62,7 +62,7 @@ func Print(err error) string { return err.Error() + fmtStack(deepestStack) } -func fmtStack(tracer interface{}) string { +func fmtStack(tracer any) string { switch t := tracer.(type) { case pkgErrorsStackTracer: return fmt.Sprintf("%+v", t.StackTrace()) diff --git a/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go b/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go index 0ffe5cddf..6390df356 100644 --- a/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go +++ b/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go @@ -21,11 +21,11 @@ package appconfig import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "strings" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/pkg/errors" "github.com/rs/zerolog" ) @@ -267,56 +267,61 @@ func (ld *Loader) loadDefaultConfig(ctx context.Context, client *github.Client, // getFileContents returns the content of the file at path on ref in owner/repo // if it exists. Returns an empty slice and false if the file does not exist. func getFileContents(ctx context.Context, client *github.Client, owner, repo, ref, path string) ([]byte, bool, error) { + // GetContents returns encoded content for files < 1MB and a download URL + // for files between 1MB and 100MB. It returns an error for files >100MB, + // but if an app has a configuration file that large, there are probably + // other issues... file, _, _, err := client.Repositories.GetContents(ctx, owner, repo, path, &github.RepositoryContentGetOptions{ Ref: ref, }) if err != nil { - switch { - case isNotFound(err): + if isNotFound(err) { return nil, false, nil - case isTooLargeError(err): - b, err := getLargeFileContents(ctx, client, owner, repo, ref, path) - return b, true, err } return nil, false, errors.Wrap(err, "failed to read file") } - // file will be nil if the path exists but is a directory + // The file will be nil if the path exists but is a directory if file == nil { return nil, false, nil } + // If decoding the content fails, ignore the error and try the download URL + // instead. The most likely error is if the file is larger than 1MB. content, err := file.GetContent() - if err != nil { - return nil, true, errors.Wrap(err, "failed to decode file content") + if err == nil { + return []byte(content), true, nil } - return []byte(content), true, nil -} + downloadURL := file.GetDownloadURL() + if downloadURL == "" { + return nil, true, errors.New("download url is empty") + } -// getLargeFileContents is similar to getFileContents, but works for files up -// to 100MB. Unlike getFileContents, it returns an error if the file does not -// exist. -func getLargeFileContents(ctx context.Context, client *github.Client, owner, repo, ref, path string) ([]byte, error) { - body, res, err := client.Repositories.DownloadContents(ctx, owner, repo, path, &github.RepositoryContentGetOptions{ - Ref: ref, - }) + req, err := http.NewRequestWithContext(ctx, "GET", downloadURL, nil) + if err != nil { + return nil, true, errors.Wrap(err, "failed to create download request") + } + + res, err := client.Client().Do(req) if err != nil { - return nil, errors.Wrap(err, "failed to read file") + return nil, true, errors.Wrap(err, "failed to download file") } + defer func() { - _ = body.Close() + _, _ = io.Copy(io.Discard, res.Body) + _ = res.Body.Close() }() if res.StatusCode != http.StatusOK { - return nil, errors.Errorf("failed to read file: unexpected status code %d", res.StatusCode) + return nil, true, errors.Errorf("failed to download file: unexpected status code %d", res.StatusCode) } - b, err := ioutil.ReadAll(body) + b, err := io.ReadAll(res.Body) if err != nil { - return nil, errors.Wrap(err, "failed to read file") + return nil, true, errors.Wrap(err, "failed to read file") } - return b, nil + return b, true, nil } func isNotFound(err error) bool { @@ -325,14 +330,3 @@ func isNotFound(err error) bool { } return false } - -func isTooLargeError(err error) bool { - if rerr, ok := err.(*github.ErrorResponse); ok { - for _, err := range rerr.Errors { - if err.Code == "too_large" { - return true - } - } - } - return false -} diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go b/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go index 8973cb562..24b2728c4 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go @@ -17,7 +17,7 @@ package githubapp import ( "fmt" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" lru "github.com/hashicorp/golang-lru" "github.com/pkg/errors" "github.com/shurcooL/githubv4" diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go b/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go index b37862da1..58f707fe0 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go @@ -24,7 +24,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/gregjones/httpcache" "github.com/pkg/errors" "github.com/shurcooL/githubv4" diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/context.go b/vendor/github.com/palantir/go-githubapp/githubapp/context.go index 799871ba5..7018ecdda 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/context.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/context.go @@ -17,7 +17,7 @@ package githubapp import ( "context" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/rs/zerolog" ) diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go b/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go index c07567a9c..313a064d5 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go @@ -19,7 +19,7 @@ import ( "fmt" "net/http" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/pkg/errors" "github.com/rcrowley/go-metrics" "github.com/rs/zerolog" diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/errors.go b/vendor/github.com/palantir/go-githubapp/githubapp/errors.go index f0da5c9f8..b57a9e35b 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/errors.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/errors.go @@ -46,12 +46,12 @@ func errorCounter(r metrics.Registry, event string) metrics.Counter { // HandlerPanicError is an error created from a recovered handler panic. type HandlerPanicError struct { - value interface{} + value any stack []runtime.Frame } // Value returns the exact value with which panic() was called. -func (e HandlerPanicError) Value() interface{} { +func (e HandlerPanicError) Value() any { return e.value } diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/installations.go b/vendor/github.com/palantir/go-githubapp/githubapp/installations.go index bcfdbf9fb..f02ec0c44 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/installations.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/installations.go @@ -19,7 +19,7 @@ import ( "fmt" "net/http" - "github.com/google/go-github/v82/github" + "github.com/google/go-github/v85/github" "github.com/pkg/errors" ) diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/scheduler.go b/vendor/github.com/palantir/go-githubapp/githubapp/scheduler.go index 8cd0bb43f..d793a96b9 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/scheduler.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/scheduler.go @@ -212,7 +212,7 @@ func QueueAsyncScheduler(queueSize int, workers int, opts ...SchedulerOption) Sc opt(&s.scheduler) } - for i := 0; i < workers; i++ { + for range workers { go func() { for d := range s.queue { if s.eventAge != nil { diff --git a/vendor/github.com/rs/zerolog/event.go b/vendor/github.com/rs/zerolog/event.go index 7538e66e9..8c9c523fb 100644 --- a/vendor/github.com/rs/zerolog/event.go +++ b/vendor/github.com/rs/zerolog/event.go @@ -466,7 +466,8 @@ func (e *Event) Err(err error) *Event { if e.stack && ErrorStackMarshaler != nil { switch m := ErrorStackMarshaler(err).(type) { case nil: - return e + // ErrorStackMarshaler returned nil — the error has no stack trace to + // attach. Fall through and still log the error via AnErr below. case LogObjectMarshaler: e = e.Object(ErrorStackFieldName, m) case error: diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 63541994e..f1ce515d5 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -152,13 +152,17 @@ var ARM struct { // The booleans in Loong64 contain the correspondingly named cpu feature bit. // The struct is padded to avoid false sharing. var Loong64 struct { - _ CacheLinePad - HasLSX bool // support 128-bit vector extension - HasLASX bool // support 256-bit vector extension - HasCRC32 bool // support CRC instruction - HasLAM_BH bool // support AM{SWAP/ADD}[_DB].{B/H} instruction - HasLAMCAS bool // support AMCAS[_DB].{B/H/W/D} instruction - _ CacheLinePad + _ CacheLinePad + HasLSX bool // support 128-bit vector extension + HasLASX bool // support 256-bit vector extension + HasCRC32 bool // support CRC instruction + HasLAMCAS bool // support AMCAS[_DB].{B/H/W/D} + HasLAM_BH bool // support AM{SWAP/ADD}[_DB].{B/H} instruction + HasLLACQ_SCREL bool // support LLACQ.{W/D}, SCREL.{W/D} instruction + HasSCQ bool // support SC.Q instruction + HasDBAR_HINTS bool // supports finer-grained DBAR hints + + _ CacheLinePad } // MIPS64X contains the supported CPU features of the current mips64/mips64le @@ -232,6 +236,7 @@ var RISCV64 struct { HasZba bool // Address generation instructions extension HasZbb bool // Basic bit-manipulation extension HasZbs bool // Single-bit instructions extension + HasZbc bool // Carryless multiplication extension HasZvbb bool // Vector Basic Bit-manipulation HasZvbc bool // Vector Carryless Multiplication HasZvkb bool // Vector Cryptography Bit-manipulation diff --git a/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go index 4ee68e38d..37ecc6644 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go +++ b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go @@ -6,6 +6,8 @@ package cpu +import "runtime" + func doinit() { setMinimalFeatures() diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go index ad741536f..f4fb52ee9 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go @@ -58,6 +58,7 @@ const ( riscv_HWPROBE_EXT_ZBA = 0x8 riscv_HWPROBE_EXT_ZBB = 0x10 riscv_HWPROBE_EXT_ZBS = 0x20 + riscv_HWPROBE_EXT_ZBC = 0x80 riscv_HWPROBE_EXT_ZVBB = 0x20000 riscv_HWPROBE_EXT_ZVBC = 0x40000 riscv_HWPROBE_EXT_ZVKB = 0x80000 @@ -108,6 +109,7 @@ func doinit() { RISCV64.HasZba = isSet(v, riscv_HWPROBE_EXT_ZBA) RISCV64.HasZbb = isSet(v, riscv_HWPROBE_EXT_ZBB) RISCV64.HasZbs = isSet(v, riscv_HWPROBE_EXT_ZBS) + RISCV64.HasZbc = isSet(v, riscv_HWPROBE_EXT_ZBC) RISCV64.HasZvbb = isSet(v, riscv_HWPROBE_EXT_ZVBB) RISCV64.HasZvbc = isSet(v, riscv_HWPROBE_EXT_ZVBC) RISCV64.HasZvkb = isSet(v, riscv_HWPROBE_EXT_ZVKB) diff --git a/vendor/golang.org/x/sys/cpu/cpu_loong64.go b/vendor/golang.org/x/sys/cpu/cpu_loong64.go index 45ecb29ae..8c234b441 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_loong64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_loong64.go @@ -15,8 +15,13 @@ const ( cpucfg1_CRC32 = 1 << 25 // CPUCFG2 bits - cpucfg2_LAM_BH = 1 << 27 - cpucfg2_LAMCAS = 1 << 28 + cpucfg2_LAM_BH = 1 << 27 + cpucfg2_LAMCAS = 1 << 28 + cpucfg2_LLACQ_SCREL = 1 << 29 + cpucfg2_SCQ = 1 << 30 + + // CPUCFG3 bits + cpucfg3_DBAR_HINTS = 1 << 17 ) func initOptions() { @@ -26,6 +31,9 @@ func initOptions() { {Name: "crc32", Feature: &Loong64.HasCRC32}, {Name: "lam_bh", Feature: &Loong64.HasLAM_BH}, {Name: "lamcas", Feature: &Loong64.HasLAMCAS}, + {Name: "llacq_screl", Feature: &Loong64.HasLLACQ_SCREL}, + {Name: "scq", Feature: &Loong64.HasSCQ}, + {Name: "dbar_hints", Feature: &Loong64.HasDBAR_HINTS}, } // The CPUCFG data on Loong64 only reflects the hardware capabilities, @@ -37,10 +45,14 @@ func initOptions() { // through CPUCFG cfg1 := get_cpucfg(1) cfg2 := get_cpucfg(2) + cfg3 := get_cpucfg(3) Loong64.HasCRC32 = cfgIsSet(cfg1, cpucfg1_CRC32) Loong64.HasLAMCAS = cfgIsSet(cfg2, cpucfg2_LAMCAS) Loong64.HasLAM_BH = cfgIsSet(cfg2, cpucfg2_LAM_BH) + Loong64.HasLLACQ_SCREL = cfgIsSet(cfg2, cpucfg2_LLACQ_SCREL) + Loong64.HasSCQ = cfgIsSet(cfg2, cpucfg2_SCQ) + Loong64.HasDBAR_HINTS = cfgIsSet(cfg3, cpucfg3_DBAR_HINTS) } func get_cpucfg(reg uint32) uint32 diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go index 0f617aef5..d4e9885f3 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go @@ -16,6 +16,7 @@ func initOptions() { {Name: "zba", Feature: &RISCV64.HasZba}, {Name: "zbb", Feature: &RISCV64.HasZbb}, {Name: "zbs", Feature: &RISCV64.HasZbs}, + {Name: "zbc", Feature: &RISCV64.HasZbc}, // RISC-V Cryptography Extensions {Name: "zvbb", Feature: &RISCV64.HasZvbb}, {Name: "zvbc", Feature: &RISCV64.HasZvbc}, diff --git a/vendor/golang.org/x/sys/cpu/cpu_windows.go b/vendor/golang.org/x/sys/cpu/cpu_windows.go new file mode 100644 index 000000000..99ec8fdfc --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_windows.go @@ -0,0 +1,26 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +//go:generate go run golang.org/x/sys/windows/mkwinsyscall -systemdll=false -output zcpu_windows.go cpu_windows.go + +//sys isProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) = kernel32.IsProcessorFeaturePresent + +// The processor features to be tested for IsProcessorFeaturePresent, see +// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent +const ( + _PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE = 30 + _PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE = 31 + _PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE = 34 + _PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE = 43 + + _PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE = 44 + _PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE = 45 + _PF_ARM_SVE_INSTRUCTIONS_AVAILABLE = 46 + _PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE = 47 + + _PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE = 64 + _PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE = 65 +) diff --git a/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go index d09e85a36..034732e55 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go @@ -4,10 +4,6 @@ package cpu -import ( - "golang.org/x/sys/windows" -) - func doinit() { // set HasASIMD and HasFP to true as per // https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#base-requirements @@ -18,25 +14,25 @@ func doinit() { ARM64.HasASIMD = true ARM64.HasFP = true - if windows.IsProcessorFeaturePresent(windows.PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) { + if isProcessorFeaturePresent(_PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) { ARM64.HasAES = true ARM64.HasPMULL = true ARM64.HasSHA1 = true ARM64.HasSHA2 = true } - ARM64.HasSHA3 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE) - ARM64.HasCRC32 = windows.IsProcessorFeaturePresent(windows.PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) - ARM64.HasSHA512 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE) - ARM64.HasATOMICS = windows.IsProcessorFeaturePresent(windows.PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) - if windows.IsProcessorFeaturePresent(windows.PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) { + ARM64.HasSHA3 = isProcessorFeaturePresent(_PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE) + ARM64.HasCRC32 = isProcessorFeaturePresent(_PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) + ARM64.HasSHA512 = isProcessorFeaturePresent(_PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE) + ARM64.HasATOMICS = isProcessorFeaturePresent(_PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) + if isProcessorFeaturePresent(_PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) { ARM64.HasASIMDDP = true ARM64.HasASIMDRDM = true } - if windows.IsProcessorFeaturePresent(windows.PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) { + if isProcessorFeaturePresent(_PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) { ARM64.HasLRCPC = true ARM64.HasSM3 = true } - ARM64.HasSVE = windows.IsProcessorFeaturePresent(windows.PF_ARM_SVE_INSTRUCTIONS_AVAILABLE) - ARM64.HasSVE2 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE) - ARM64.HasJSCVT = windows.IsProcessorFeaturePresent(windows.PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) + ARM64.HasSVE = isProcessorFeaturePresent(_PF_ARM_SVE_INSTRUCTIONS_AVAILABLE) + ARM64.HasSVE2 = isProcessorFeaturePresent(_PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE) + ARM64.HasJSCVT = isProcessorFeaturePresent(_PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) } diff --git a/vendor/golang.org/x/sys/cpu/zcpu_windows.go b/vendor/golang.org/x/sys/cpu/zcpu_windows.go new file mode 100644 index 000000000..6411a7a71 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/zcpu_windows.go @@ -0,0 +1,48 @@ +// Code generated by 'go generate'; DO NOT EDIT. + +package cpu + +import ( + "syscall" + "unsafe" +) + +var _ unsafe.Pointer + +// Do the interface allocations only once for common +// Errno values. +const ( + errnoERROR_IO_PENDING = 997 +) + +var ( + errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) + errERROR_EINVAL error = syscall.EINVAL +) + +// errnoErr returns common boxed Errno values, to prevent +// allocations at runtime. +func errnoErr(e syscall.Errno) error { + switch e { + case 0: + return errERROR_EINVAL + case errnoERROR_IO_PENDING: + return errERROR_IO_PENDING + } + // TODO: add more here, after collecting data on the common + // error values see on Windows. (perhaps when running + // all.bat?) + return e +} + +var ( + modkernel32 = syscall.NewLazyDLL("kernel32.dll") + + procIsProcessorFeaturePresent = modkernel32.NewProc("IsProcessorFeaturePresent") +) + +func isProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) { + r0, _, _ := syscall.SyscallN(procIsProcessorFeaturePresent.Addr(), uintptr(ProcessorFeature)) + ret = r0 != 0 + return +} diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go index 3ea470387..acd6257fa 100644 --- a/vendor/golang.org/x/sys/unix/affinity_linux.go +++ b/vendor/golang.org/x/sys/unix/affinity_linux.go @@ -13,11 +13,19 @@ import ( const cpuSetSize = _CPU_SETSIZE / _NCPUBITS -// CPUSet represents a CPU affinity mask. +// CPUSet represents a bit mask of CPUs, to be used with [SchedGetaffinity], [SchedSetaffinity], +// and [SetMemPolicy]. +// +// Note this type can only represent CPU IDs 0 through 1023. +// Use [CPUSetDynamic]/[NewCPUSet] instead to avoid this limit. type CPUSet [cpuSetSize]cpuMask -func schedAffinity(trap uintptr, pid int, set *CPUSet) error { - _, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set))) +// CPUSetDynamic represents a bit mask of CPUs, to be used with [SchedGetaffinityDynamic], +// [SchedSetaffinityDynamic], and [SetMemPolicyDynamic]. Use [NewCPUSet] to allocate. +type CPUSetDynamic []cpuMask + +func schedAffinity(trap uintptr, pid int, size uintptr, ptr unsafe.Pointer) error { + _, _, e := RawSyscall(trap, uintptr(pid), uintptr(size), uintptr(ptr)) if e != 0 { return errnoErr(e) } @@ -27,13 +35,13 @@ func schedAffinity(trap uintptr, pid int, set *CPUSet) error { // SchedGetaffinity gets the CPU affinity mask of the thread specified by pid. // If pid is 0 the calling thread is used. func SchedGetaffinity(pid int, set *CPUSet) error { - return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set) + return schedAffinity(SYS_SCHED_GETAFFINITY, pid, unsafe.Sizeof(*set), unsafe.Pointer(set)) } // SchedSetaffinity sets the CPU affinity mask of the thread specified by pid. // If pid is 0 the calling thread is used. func SchedSetaffinity(pid int, set *CPUSet) error { - return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set) + return schedAffinity(SYS_SCHED_SETAFFINITY, pid, unsafe.Sizeof(*set), unsafe.Pointer(set)) } // Zero clears the set s, so that it contains no CPUs. @@ -45,9 +53,7 @@ func (s *CPUSet) Zero() { // will silently ignore any invalid CPU bits in [CPUSet] so this is an // efficient way of resetting the CPU affinity of a process. func (s *CPUSet) Fill() { - for i := range s { - s[i] = ^cpuMask(0) - } + cpuMaskFill(s[:]) } func cpuBitsIndex(cpu int) int { @@ -58,24 +64,27 @@ func cpuBitsMask(cpu int) cpuMask { return cpuMask(1 << (uint(cpu) % _NCPUBITS)) } -// Set adds cpu to the set s. -func (s *CPUSet) Set(cpu int) { +func cpuMaskFill(s []cpuMask) { + for i := range s { + s[i] = ^cpuMask(0) + } +} + +func cpuMaskSet(s []cpuMask, cpu int) { i := cpuBitsIndex(cpu) if i < len(s) { s[i] |= cpuBitsMask(cpu) } } -// Clear removes cpu from the set s. -func (s *CPUSet) Clear(cpu int) { +func cpuMaskClear(s []cpuMask, cpu int) { i := cpuBitsIndex(cpu) if i < len(s) { s[i] &^= cpuBitsMask(cpu) } } -// IsSet reports whether cpu is in the set s. -func (s *CPUSet) IsSet(cpu int) bool { +func cpuMaskIsSet(s []cpuMask, cpu int) bool { i := cpuBitsIndex(cpu) if i < len(s) { return s[i]&cpuBitsMask(cpu) != 0 @@ -83,11 +92,98 @@ func (s *CPUSet) IsSet(cpu int) bool { return false } -// Count returns the number of CPUs in the set s. -func (s *CPUSet) Count() int { +func cpuMaskCount(s []cpuMask) int { c := 0 for _, b := range s { c += bits.OnesCount64(uint64(b)) } return c } + +// Set adds cpu to the set s. If cpu is out of bounds for s, no action is taken. +func (s *CPUSet) Set(cpu int) { + cpuMaskSet(s[:], cpu) +} + +// Clear removes cpu from the set s. If cpu is out of bounds for s, no action is taken. +func (s *CPUSet) Clear(cpu int) { + cpuMaskClear(s[:], cpu) +} + +// IsSet reports whether cpu is in the set s. +func (s *CPUSet) IsSet(cpu int) bool { + return cpuMaskIsSet(s[:], cpu) +} + +// Count returns the number of CPUs in the set s. +func (s *CPUSet) Count() int { + return cpuMaskCount(s[:]) +} + +// NewCPUSet creates a CPU affinity mask capable of representing CPU IDs +// up to maxCPU (exclusive). +func NewCPUSet(maxCPU int) CPUSetDynamic { + numMasks := (maxCPU + _NCPUBITS - 1) / _NCPUBITS + if numMasks == 0 { + numMasks = 1 + } + return make(CPUSetDynamic, numMasks) +} + +// Zero clears the set s, so that it contains no CPUs. +func (s CPUSetDynamic) Zero() { + clear(s) +} + +// Fill adds all possible CPU bits to the set s. On Linux, [SchedSetaffinityDynamic] +// will silently ignore any invalid CPU bits in [CPUSetDynamic] so this is an +// efficient way of resetting the CPU affinity of a process. +func (s CPUSetDynamic) Fill() { + cpuMaskFill(s) +} + +// Set adds cpu to the set s. If cpu is out of bounds for s, no action is taken. +func (s CPUSetDynamic) Set(cpu int) { + cpuMaskSet(s, cpu) +} + +// Clear removes cpu from the set s. If cpu is out of bounds for s, no action is taken. +func (s CPUSetDynamic) Clear(cpu int) { + cpuMaskClear(s, cpu) +} + +// IsSet reports whether cpu is in the set s. +func (s CPUSetDynamic) IsSet(cpu int) bool { + return cpuMaskIsSet(s, cpu) +} + +// Count returns the number of CPUs in the set s. +func (s CPUSetDynamic) Count() int { + return cpuMaskCount(s) +} + +func (s CPUSetDynamic) size() uintptr { + return uintptr(len(s)) * unsafe.Sizeof(cpuMask(0)) +} + +func (s CPUSetDynamic) pointer() unsafe.Pointer { + if len(s) == 0 { + return nil + } + return unsafe.Pointer(&s[0]) +} + +// SchedGetaffinityDynamic gets the CPU affinity mask of the thread specified by pid. +// If pid is 0 the calling thread is used. +// +// If the set is smaller than the size of the affinity mask used by the kernel, +// [EINVAL] is returned. +func SchedGetaffinityDynamic(pid int, set CPUSetDynamic) error { + return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set.size(), set.pointer()) +} + +// SchedSetaffinityDynamic sets the CPU affinity mask of the thread specified by pid. +// If pid is 0 the calling thread is used. +func SchedSetaffinityDynamic(pid int, set CPUSetDynamic) error { + return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set.size(), set.pointer()) +} diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index d0ed61191..f6ddee1ae 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -51,7 +51,7 @@ if [[ "$GOOS" = "linux" ]]; then # Files generated through docker (use $cmd so you can Ctl-C the build or run) set -e $cmd docker build --tag generate:$GOOS $GOOS - $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS + $cmd docker run --rm --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS exit fi diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index fd39be4ef..fa74cfe9e 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -354,6 +354,9 @@ struct ltchars { // Renamed in v6.16, commit c6d732c38f93 ("net: ethtool: remove duplicate defines for family info") #define ETHTOOL_FAMILY_NAME ETHTOOL_GENL_NAME #define ETHTOOL_FAMILY_VERSION ETHTOOL_GENL_VERSION + +// Removed in v6.17, commit 760e6f7befba ("futex: Remove support for IMMUTABLE") +#define PR_FUTEX_HASH_GET_IMMUTABLE 3 ' includes_NetBSD=' diff --git a/vendor/golang.org/x/sys/unix/readv_unix.go b/vendor/golang.org/x/sys/unix/readv_unix.go new file mode 100644 index 000000000..38a2be937 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/readv_unix.go @@ -0,0 +1,103 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin || linux || openbsd + +package unix + +import "unsafe" + +// minIovec is the size of the small initial allocation used by +// Readv, Writev, etc. +// +// This small allocation gets stack allocated, which lets the +// common use case of len(iovs) <= minIovec avoid more expensive +// heap allocations. +const minIovec = 8 + +// appendBytes converts bs to Iovecs and appends them to vecs. +func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { + for _, b := range bs { + var v Iovec + v.SetLen(len(b)) + if len(b) > 0 { + v.Base = &b[0] + } else { + v.Base = (*byte)(unsafe.Pointer(&_zero)) + } + vecs = append(vecs, v) + } + return vecs +} + +// writevRaceDetect tells the race detector that the program +// has read the first n bytes stored in iovecs. +func writevRaceDetect(iovecs []Iovec, n int) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := min(int(iovecs[i].Len), n) + n -= m + if m > 0 { + raceReadRange(unsafe.Pointer(iovecs[i].Base), m) + } + } +} + +// readvRaceDetect tells the race detector that the program +// has written to the first n bytes stored in iovecs. +func readvRaceDetect(iovecs []Iovec, n int, err error) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := min(int(iovecs[i].Len), n) + n -= m + if m > 0 { + raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) + } + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } +} + +func Readv(fd int, iovs [][]byte) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = readv(fd, iovecs) + readvRaceDetect(iovecs, n, err) + return n, err +} + +func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = preadv(fd, iovecs, offset) + readvRaceDetect(iovecs, n, err) + return n, err +} + +func Writev(fd int, iovs [][]byte) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = writev(fd, iovecs) + writevRaceDetect(iovecs, n) + return n, err +} + +func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = pwritev(fd, iovecs, offset) + writevRaceDetect(iovecs, n) + return n, err +} diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 7838ca5db..38590ca81 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -602,95 +602,6 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI return } -const minIovec = 8 - -func Readv(fd int, iovs [][]byte) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - n, err = readv(fd, iovecs) - readvRacedetect(iovecs, n, err) - return n, err -} - -func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - n, err = preadv(fd, iovecs, offset) - readvRacedetect(iovecs, n, err) - return n, err -} - -func Writev(fd int, iovs [][]byte) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - n, err = writev(fd, iovecs) - writevRacedetect(iovecs, n) - return n, err -} - -func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - n, err = pwritev(fd, iovecs, offset) - writevRacedetect(iovecs, n) - return n, err -} - -func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { - for _, b := range bs { - var v Iovec - v.SetLen(len(b)) - if len(b) > 0 { - v.Base = &b[0] - } else { - v.Base = (*byte)(unsafe.Pointer(&_zero)) - } - vecs = append(vecs, v) - } - return vecs -} - -func writevRacedetect(iovecs []Iovec, n int) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } - n -= m - if m > 0 { - raceReadRange(unsafe.Pointer(iovecs[i].Base), m) - } - } -} - -func readvRacedetect(iovecs []Iovec, n int, err error) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } - n -= m - if m > 0 { - raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) - } - } - if err == nil { - raceAcquire(unsafe.Pointer(&ioSync)) - } -} - //sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 06c0eea6f..ce4d7ab1e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -2150,33 +2150,10 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { //sys exitThread(code int) (err error) = SYS_EXIT //sys readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV //sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV -//sys preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV -//sys pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV -//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2 -//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2 - -// minIovec is the size of the small initial allocation used by -// Readv, Writev, etc. -// -// This small allocation gets stack allocated, which lets the -// common use case of len(iovs) <= minIovs avoid more expensive -// heap allocations. -const minIovec = 8 - -// appendBytes converts bs to Iovecs and appends them to vecs. -func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { - for _, b := range bs { - var v Iovec - v.SetLen(len(b)) - if len(b) > 0 { - v.Base = &b[0] - } else { - v.Base = (*byte)(unsafe.Pointer(&_zero)) - } - vecs = append(vecs, v) - } - return vecs -} +//sys preadvSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV +//sys pwritevSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV +//sys preadv2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2 +//sys pwritev2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2 // offs2lohi splits offs into its low and high order bits. func offs2lohi(offs int64) (lo, hi uintptr) { @@ -2184,69 +2161,23 @@ func offs2lohi(offs int64) (lo, hi uintptr) { return uintptr(offs), uintptr(uint64(offs) >> (longBits - 1) >> 1) // two shifts to avoid false positive in vet } -func Readv(fd int, iovs [][]byte) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - n, err = readv(fd, iovecs) - readvRacedetect(iovecs, n, err) - return n, err -} - -func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { lo, hi := offs2lohi(offset) - n, err = preadv(fd, iovecs, lo, hi) - readvRacedetect(iovecs, n, err) - return n, err + return preadvSyscall(fd, iovecs, lo, hi) } func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) lo, hi := offs2lohi(offset) - n, err = preadv2(fd, iovecs, lo, hi, flags) - readvRacedetect(iovecs, n, err) - return n, err -} - -func readvRacedetect(iovecs []Iovec, n int, err error) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := min(int(iovecs[i].Len), n) - n -= m - if m > 0 { - raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) - } - } - if err == nil { - raceAcquire(unsafe.Pointer(&ioSync)) - } -} - -func Writev(fd int, iovs [][]byte) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - n, err = writev(fd, iovecs) - writevRacedetect(iovecs, n) + n, err = preadv2Syscall(fd, iovecs, lo, hi, flags) + readvRaceDetect(iovecs, n, err) return n, err } -func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { lo, hi := offs2lohi(offset) - n, err = pwritev(fd, iovecs, lo, hi) - writevRacedetect(iovecs, n) - return n, err + return pwritevSyscall(fd, iovecs, lo, hi) } func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { @@ -2256,24 +2187,11 @@ func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) raceReleaseMerge(unsafe.Pointer(&ioSync)) } lo, hi := offs2lohi(offset) - n, err = pwritev2(fd, iovecs, lo, hi, flags) - writevRacedetect(iovecs, n) + n, err = pwritev2Syscall(fd, iovecs, lo, hi, flags) + writevRaceDetect(iovecs, n) return n, err } -func writevRacedetect(iovecs []Iovec, n int) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := min(int(iovecs[i].Len), n) - n -= m - if m > 0 { - raceReadRange(unsafe.Pointer(iovecs[i].Base), m) - } - } -} - // mmap varies by architecture; see syscall_linux_*.go. //sys munmap(addr uintptr, length uintptr) (err error) //sys mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error) @@ -2644,8 +2562,12 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) //sys Mseal(b []byte, flags uint) (err error) -//sys setMemPolicy(mode int, mask *CPUSet, size int) (err error) = SYS_SET_MEMPOLICY +//sys setMemPolicy(mode int, mask unsafe.Pointer, size uintptr) (err error) = SYS_SET_MEMPOLICY func SetMemPolicy(mode int, mask *CPUSet) error { - return setMemPolicy(mode, mask, _CPU_SETSIZE) + return setMemPolicy(mode, unsafe.Pointer(mask), _CPU_SETSIZE) +} + +func SetMemPolicyDynamic(mode int, mask CPUSetDynamic) error { + return setMemPolicy(mode, mask.pointer(), mask.size()) } diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index cd2dd797f..ecf92bfa2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -82,6 +82,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 745e5c7e6..173738077 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -113,6 +113,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go index dd2262a40..a3fd1d0b8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go @@ -150,6 +150,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index 8cf3670bd..fc5543c5f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -112,6 +112,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index b86ded549..7b0ef8e12 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -300,6 +300,10 @@ func Uname(uname *Utsname) error { //sys Pathconf(path string, name int) (val int, err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) //sys pwrite(fd int, p []byte, offset int64) (n int, err error) +//sys readv(fd int, iovecs []Iovec) (n int, err error) +//sys writev(fd int, iovecs []Iovec) (n int, err error) +//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) +//sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 120a7b35d..9d72a6b73 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -353,8 +353,10 @@ const ( AUDIT_MAC_IPSEC_EVENT = 0x587 AUDIT_MAC_MAP_ADD = 0x581 AUDIT_MAC_MAP_DEL = 0x582 + AUDIT_MAC_OBJ_CONTEXTS = 0x592 AUDIT_MAC_POLICY_LOAD = 0x57b AUDIT_MAC_STATUS = 0x57c + AUDIT_MAC_TASK_CONTEXTS = 0x591 AUDIT_MAC_UNLBL_ALLOW = 0x57e AUDIT_MAC_UNLBL_STCADD = 0x588 AUDIT_MAC_UNLBL_STCDEL = 0x589 @@ -591,8 +593,13 @@ const ( CAN_CTRLMODE_LOOPBACK = 0x1 CAN_CTRLMODE_ONE_SHOT = 0x8 CAN_CTRLMODE_PRESUME_ACK = 0x40 + CAN_CTRLMODE_RESTRICTED = 0x800 CAN_CTRLMODE_TDC_AUTO = 0x200 CAN_CTRLMODE_TDC_MANUAL = 0x400 + CAN_CTRLMODE_XL = 0x1000 + CAN_CTRLMODE_XL_TDC_AUTO = 0x2000 + CAN_CTRLMODE_XL_TDC_MANUAL = 0x4000 + CAN_CTRLMODE_XL_TMS = 0x8000 CAN_EFF_FLAG = 0x80000000 CAN_EFF_ID_BITS = 0x1d CAN_EFF_MASK = 0x1fffffff @@ -800,6 +807,8 @@ const ( DEVLINK_PORT_FN_CAP_IPSEC_PACKET = 0x8 DEVLINK_PORT_FN_CAP_MIGRATABLE = 0x2 DEVLINK_PORT_FN_CAP_ROCE = 0x1 + DEVLINK_RATE_TCS_MAX = 0x8 + DEVLINK_RATE_TC_INDEX_MAX = 0x7 DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14 DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS = 0x3 DEVMEM_MAGIC = 0x454d444d @@ -1186,6 +1195,7 @@ const ( ETH_P_MPLS_UC = 0x8847 ETH_P_MRP = 0x88e3 ETH_P_MVRP = 0x88f5 + ETH_P_MXLGSW = 0x88c3 ETH_P_NCSI = 0x88f8 ETH_P_NSH = 0x894f ETH_P_PAE = 0x888e @@ -1218,6 +1228,7 @@ const ( ETH_P_WCCP = 0x883e ETH_P_X25 = 0x805 ETH_P_XDSA = 0xf8 + ETH_P_YT921X = 0x9988 ET_CORE = 0x4 ET_DYN = 0x3 ET_EXEC = 0x2 @@ -1258,6 +1269,7 @@ const ( FALLOC_FL_NO_HIDE_STALE = 0x4 FALLOC_FL_PUNCH_HOLE = 0x2 FALLOC_FL_UNSHARE_RANGE = 0x40 + FALLOC_FL_WRITE_ZEROES = 0x80 FALLOC_FL_ZERO_RANGE = 0x10 FANOTIFY_METADATA_VERSION = 0x3 FAN_ACCESS = 0x1 @@ -1477,6 +1489,7 @@ const ( GRND_INSECURE = 0x4 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 + GUEST_MEMFD_MAGIC = 0x474d454d HDIO_DRIVE_CMD = 0x31f HDIO_DRIVE_CMD_AEB = 0x31e HDIO_DRIVE_CMD_HDR_SIZE = 0x4 @@ -1517,6 +1530,7 @@ const ( HDIO_SET_XFER = 0x306 HDIO_TRISTATE_HWIF = 0x31b HDIO_UNREGISTER_HWIF = 0x32a + HIDIOCTL_LAST = 0xd HID_MAX_DESCRIPTOR_SIZE = 0x1000 HOSTFS_SUPER_MAGIC = 0xc0ffee HPFS_SUPER_MAGIC = 0xf995e849 @@ -1809,6 +1823,8 @@ const ( KEXEC_ARCH_X86_64 = 0x3e0000 KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8 KEXEC_FILE_DEBUG = 0x8 + KEXEC_FILE_FORCE_DTB = 0x20 + KEXEC_FILE_NO_CMA = 0x10 KEXEC_FILE_NO_INITRAMFS = 0x4 KEXEC_FILE_ON_CRASH = 0x2 KEXEC_FILE_UNLOAD = 0x1 @@ -1905,6 +1921,7 @@ const ( LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON = 0x2 LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF = 0x1 LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF = 0x4 + LANDLOCK_RESTRICT_SELF_TSYNC = 0x8 LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1 LANDLOCK_SCOPE_SIGNAL = 0x2 LINUX_REBOOT_CMD_CAD_OFF = 0x0 @@ -2412,6 +2429,7 @@ const ( NN_PRXFPREG = "LINUX" NN_RISCV_CSR = "LINUX" NN_RISCV_TAGGED_ADDR_CTRL = "LINUX" + NN_RISCV_USER_CFI = "LINUX" NN_RISCV_VECTOR = "LINUX" NN_S390_CTRS = "LINUX" NN_S390_GS_BC = "LINUX" @@ -2493,6 +2511,7 @@ const ( NT_PRXFPREG = 0x46e62b7f NT_RISCV_CSR = 0x900 NT_RISCV_TAGGED_ADDR_CTRL = 0x902 + NT_RISCV_USER_CFI = 0x903 NT_RISCV_VECTOR = 0x901 NT_S390_CTRS = 0x304 NT_S390_GS_BC = 0x30c @@ -2515,6 +2534,7 @@ const ( NT_X86_SHSTK = 0x204 NT_X86_XSAVE_LAYOUT = 0x205 NT_X86_XSTATE = 0x202 + NULL_FS_MAGIC = 0x4e554c4c OCFS2_SUPER_MAGIC = 0x7461636f OCRNL = 0x8 OFDEL = 0x80 @@ -2594,6 +2614,7 @@ const ( PERF_ATTR_SIZE_VER6 = 0x78 PERF_ATTR_SIZE_VER7 = 0x80 PERF_ATTR_SIZE_VER8 = 0x88 + PERF_ATTR_SIZE_VER9 = 0x90 PERF_AUX_FLAG_COLLISION = 0x8 PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT = 0x0 PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW = 0x100 @@ -2629,6 +2650,7 @@ const ( PERF_MEM_LVLNUM_ANY_CACHE = 0xb PERF_MEM_LVLNUM_CXL = 0x9 PERF_MEM_LVLNUM_IO = 0xa + PERF_MEM_LVLNUM_L0 = 0x7 PERF_MEM_LVLNUM_L1 = 0x1 PERF_MEM_LVLNUM_L2 = 0x2 PERF_MEM_LVLNUM_L2_MHB = 0x5 @@ -2662,6 +2684,23 @@ const ( PERF_MEM_OP_PFETCH = 0x8 PERF_MEM_OP_SHIFT = 0x0 PERF_MEM_OP_STORE = 0x4 + PERF_MEM_REGION_L_NON_SHARE = 0x3 + PERF_MEM_REGION_L_SHARE = 0x2 + PERF_MEM_REGION_MEM0 = 0x8 + PERF_MEM_REGION_MEM1 = 0x9 + PERF_MEM_REGION_MEM2 = 0xa + PERF_MEM_REGION_MEM3 = 0xb + PERF_MEM_REGION_MEM4 = 0xc + PERF_MEM_REGION_MEM5 = 0xd + PERF_MEM_REGION_MEM6 = 0xe + PERF_MEM_REGION_MEM7 = 0xf + PERF_MEM_REGION_MMIO = 0x7 + PERF_MEM_REGION_NA = 0x0 + PERF_MEM_REGION_O_IO = 0x4 + PERF_MEM_REGION_O_NON_SHARE = 0x6 + PERF_MEM_REGION_O_SHARE = 0x5 + PERF_MEM_REGION_RSVD = 0x1 + PERF_MEM_REGION_SHIFT = 0x2e PERF_MEM_REMOTE_REMOTE = 0x1 PERF_MEM_REMOTE_SHIFT = 0x25 PERF_MEM_SNOOPX_FWD = 0x1 @@ -2776,6 +2815,10 @@ const ( PR_CAP_AMBIENT_IS_SET = 0x1 PR_CAP_AMBIENT_LOWER = 0x3 PR_CAP_AMBIENT_RAISE = 0x2 + PR_CFI_BRANCH_LANDING_PADS = 0x0 + PR_CFI_DISABLE = 0x2 + PR_CFI_ENABLE = 0x1 + PR_CFI_LOCK = 0x4 PR_ENDIAN_BIG = 0x0 PR_ENDIAN_LITTLE = 0x1 PR_ENDIAN_PPC_LITTLE = 0x2 @@ -2798,6 +2841,7 @@ const ( PR_FUTEX_HASH_GET_SLOTS = 0x2 PR_FUTEX_HASH_SET_SLOTS = 0x1 PR_GET_AUXV = 0x41555856 + PR_GET_CFI = 0x50 PR_GET_CHILD_SUBREAPER = 0x25 PR_GET_DUMPABLE = 0x3 PR_GET_ENDIAN = 0x13 @@ -2834,6 +2878,7 @@ const ( PR_MDWE_REFUSE_EXEC_GAIN = 0x1 PR_MPX_DISABLE_MANAGEMENT = 0x2c PR_MPX_ENABLE_MANAGEMENT = 0x2b + PR_MTE_STORE_ONLY = 0x80000 PR_MTE_TAG_MASK = 0x7fff8 PR_MTE_TAG_SHIFT = 0x3 PR_MTE_TCF_ASYNC = 0x4 @@ -2877,6 +2922,10 @@ const ( PR_RISCV_V_VSTATE_CTRL_NEXT_MASK = 0xc PR_RISCV_V_VSTATE_CTRL_OFF = 0x1 PR_RISCV_V_VSTATE_CTRL_ON = 0x2 + PR_RSEQ_SLICE_EXTENSION = 0x4f + PR_RSEQ_SLICE_EXTENSION_GET = 0x1 + PR_RSEQ_SLICE_EXTENSION_SET = 0x2 + PR_RSEQ_SLICE_EXT_ENABLE = 0x1 PR_SCHED_CORE = 0x3e PR_SCHED_CORE_CREATE = 0x1 PR_SCHED_CORE_GET = 0x0 @@ -2886,6 +2935,7 @@ const ( PR_SCHED_CORE_SCOPE_THREAD_GROUP = 0x1 PR_SCHED_CORE_SHARE_FROM = 0x3 PR_SCHED_CORE_SHARE_TO = 0x2 + PR_SET_CFI = 0x51 PR_SET_CHILD_SUBREAPER = 0x24 PR_SET_DUMPABLE = 0x4 PR_SET_ENDIAN = 0x14 @@ -2951,11 +3001,14 @@ const ( PR_SVE_SET_VL_ONEXEC = 0x40000 PR_SVE_VL_INHERIT = 0x20000 PR_SVE_VL_LEN_MASK = 0xffff + PR_SYS_DISPATCH_EXCLUSIVE_ON = 0x1 + PR_SYS_DISPATCH_INCLUSIVE_ON = 0x2 PR_SYS_DISPATCH_OFF = 0x0 PR_SYS_DISPATCH_ON = 0x1 PR_TAGGED_ADDR_ENABLE = 0x1 PR_TASK_PERF_EVENTS_DISABLE = 0x1f PR_TASK_PERF_EVENTS_ENABLE = 0x20 + PR_THP_DISABLE_EXCEPT_ADVISED = 0x2 PR_TIMER_CREATE_RESTORE_IDS = 0x4d PR_TIMER_CREATE_RESTORE_IDS_GET = 0x2 PR_TIMER_CREATE_RESTORE_IDS_OFF = 0x0 @@ -2987,8 +3040,10 @@ const ( PTP_STRICT_FLAGS = 0x8 PTP_SYS_OFFSET_EXTENDED = 0xc4c03d09 PTP_SYS_OFFSET_EXTENDED2 = 0xc4c03d12 + PTP_SYS_OFFSET_EXTENDED_CYCLES = 0xc4c03d16 PTP_SYS_OFFSET_PRECISE = 0xc0403d08 PTP_SYS_OFFSET_PRECISE2 = 0xc0403d11 + PTP_SYS_OFFSET_PRECISE_CYCLES = 0xc0403d15 PTRACE_ATTACH = 0x10 PTRACE_CONT = 0x7 PTRACE_DETACH = 0x11 @@ -3330,8 +3385,9 @@ const ( RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 RWF_NOAPPEND = 0x20 + RWF_NOSIGNAL = 0x100 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0xff + RWF_SUPPORTED = 0x1ff RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -3714,7 +3770,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0x10 + TASKSTATS_VERSION = 0x11 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -4052,6 +4108,7 @@ const ( XDP_FLAGS_REPLACE = 0x10 XDP_FLAGS_SKB_MODE = 0x2 XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MAX_TX_SKB_BUDGET = 0x9 XDP_MMAP_OFFSETS = 0x1 XDP_OPTIONS = 0x8 XDP_OPTIONS_ZEROCOPY = 0x1 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 97a61fc5b..c0a8ea1de 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -159,6 +159,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -305,6 +306,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -352,6 +354,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -596,6 +599,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -819,7 +824,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index a0d6d498c..ff927c830 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -159,6 +159,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -306,6 +307,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -353,6 +355,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -596,6 +599,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -819,7 +824,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index dd9c903f9..55294eda5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -311,6 +312,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -358,6 +360,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -601,6 +604,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -824,7 +829,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 384c61ca3..5dac54c35 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -161,6 +161,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -598,6 +601,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -821,7 +826,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 6384c9831..46ac1fcb2 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -160,6 +160,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -298,6 +299,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -345,6 +347,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -588,6 +591,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -811,7 +816,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 553c1c6f1..b55483e8a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index b3339f209..71890c98a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 177091d2b..a78b6cc14 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index c5abf156d..d0e38ca73 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index f1f3fadf5..c883e14c7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -158,6 +158,7 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -359,6 +360,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -406,6 +408,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -653,6 +656,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -877,7 +882,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 203ad9c54..1834273d4 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -158,6 +158,7 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -363,6 +364,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -410,6 +412,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -657,6 +660,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -881,7 +886,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 4b9abcb21..39945dd9a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -158,6 +158,7 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -363,6 +364,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -410,6 +412,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -657,6 +660,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -881,7 +886,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index f87983037..bc0f37241 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -11,553 +11,569 @@ package unix import "syscall" const ( - B1000000 = 0x1008 - B115200 = 0x1002 - B1152000 = 0x1009 - B1500000 = 0x100a - B2000000 = 0x100b - B230400 = 0x1003 - B2500000 = 0x100c - B3000000 = 0x100d - B3500000 = 0x100e - B4000000 = 0x100f - B460800 = 0x1004 - B500000 = 0x1005 - B57600 = 0x1001 - B576000 = 0x1006 - B921600 = 0x1007 - BLKALIGNOFF = 0x127a - BLKBSZGET = 0x80081270 - BLKBSZSET = 0x40081271 - BLKDISCARD = 0x1277 - BLKDISCARDZEROES = 0x127c - BLKFLSBUF = 0x1261 - BLKFRAGET = 0x1265 - BLKFRASET = 0x1264 - BLKGETDISKSEQ = 0x80081280 - BLKGETSIZE = 0x1260 - BLKGETSIZE64 = 0x80081272 - BLKIOMIN = 0x1278 - BLKIOOPT = 0x1279 - BLKPBSZGET = 0x127b - BLKRAGET = 0x1263 - BLKRASET = 0x1262 - BLKROGET = 0x125e - BLKROSET = 0x125d - BLKROTATIONAL = 0x127e - BLKRRPART = 0x125f - BLKSECDISCARD = 0x127d - BLKSECTGET = 0x1267 - BLKSECTSET = 0x1266 - BLKSSZGET = 0x1268 - BLKZEROOUT = 0x127f - BOTHER = 0x1000 - BS1 = 0x2000 - BSDLY = 0x2000 - CBAUD = 0x100f - CBAUDEX = 0x1000 - CIBAUD = 0x100f0000 - CLOCAL = 0x800 - CR1 = 0x200 - CR2 = 0x400 - CR3 = 0x600 - CRDLY = 0x600 - CREAD = 0x80 - CS6 = 0x10 - CS7 = 0x20 - CS8 = 0x30 - CSIZE = 0x30 - CSTOPB = 0x40 - DM_MPATH_PROBE_PATHS = 0xfd12 - ECCGETLAYOUT = 0x81484d11 - ECCGETSTATS = 0x80104d12 - ECHOCTL = 0x200 - ECHOE = 0x10 - ECHOK = 0x20 - ECHOKE = 0x800 - ECHONL = 0x40 - ECHOPRT = 0x400 - EFD_CLOEXEC = 0x80000 - EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 - EPOLL_CLOEXEC = 0x80000 - EXTPROC = 0x10000 - FF1 = 0x8000 - FFDLY = 0x8000 - FICLONE = 0x40049409 - FICLONERANGE = 0x4020940d - FLUSHO = 0x1000 - FS_IOC_ENABLE_VERITY = 0x40806685 - FS_IOC_GETFLAGS = 0x80086601 - FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b - FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 - FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 - FS_IOC_SETFLAGS = 0x40086602 - FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 - F_GETLK = 0x5 - F_GETLK64 = 0x5 - F_GETOWN = 0x9 - F_RDLCK = 0x0 - F_SETLK = 0x6 - F_SETLK64 = 0x6 - F_SETLKW = 0x7 - F_SETLKW64 = 0x7 - F_SETOWN = 0x8 - F_UNLCK = 0x2 - F_WRLCK = 0x1 - HIDIOCGRAWINFO = 0x80084803 - HIDIOCGRDESC = 0x90044802 - HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d - HUPCL = 0x400 - ICANON = 0x2 - IEXTEN = 0x8000 - IN_CLOEXEC = 0x80000 - IN_NONBLOCK = 0x800 - IOCTL_MEI_NOTIFY_GET = 0x80044803 - IOCTL_MEI_NOTIFY_SET = 0x40044802 - IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 - IPV6_FLOWINFO_MASK = 0xffffff0f - IPV6_FLOWLABEL_MASK = 0xffff0f00 - ISIG = 0x1 - IUCLC = 0x200 - IXOFF = 0x1000 - IXON = 0x400 - MAP_ANON = 0x20 - MAP_ANONYMOUS = 0x20 - MAP_DENYWRITE = 0x800 - MAP_EXECUTABLE = 0x1000 - MAP_GROWSDOWN = 0x100 - MAP_HUGETLB = 0x40000 - MAP_LOCKED = 0x2000 - MAP_NONBLOCK = 0x10000 - MAP_NORESERVE = 0x4000 - MAP_POPULATE = 0x8000 - MAP_STACK = 0x20000 - MAP_SYNC = 0x80000 - MCL_CURRENT = 0x1 - MCL_FUTURE = 0x2 - MCL_ONFAULT = 0x4 - MEMERASE = 0x40084d02 - MEMERASE64 = 0x40104d14 - MEMGETBADBLOCK = 0x40084d0b - MEMGETINFO = 0x80204d01 - MEMGETOOBSEL = 0x80c84d0a - MEMGETREGIONCOUNT = 0x80044d07 - MEMISLOCKED = 0x80084d17 - MEMLOCK = 0x40084d05 - MEMREAD = 0xc0404d1a - MEMREADOOB = 0xc0104d04 - MEMSETBADBLOCK = 0x40084d0c - MEMUNLOCK = 0x40084d06 - MEMWRITEOOB = 0xc0104d03 - MTDFILEMODE = 0x4d13 - NFDBITS = 0x40 - NLDLY = 0x100 - NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 - NS_GET_NSTYPE = 0xb703 - NS_GET_OWNER_UID = 0xb704 - NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 - NS_GET_USERNS = 0xb701 - OLCUC = 0x2 - ONLCR = 0x4 - OTPERASE = 0x400c4d19 - OTPGETREGIONCOUNT = 0x40044d0e - OTPGETREGIONINFO = 0x400c4d0f - OTPLOCK = 0x800c4d10 - OTPSELECT = 0x80044d0d - O_APPEND = 0x400 - O_ASYNC = 0x2000 - O_CLOEXEC = 0x80000 - O_CREAT = 0x40 - O_DIRECT = 0x4000 - O_DIRECTORY = 0x10000 - O_DSYNC = 0x1000 - O_EXCL = 0x80 - O_FSYNC = 0x101000 - O_LARGEFILE = 0x0 - O_NDELAY = 0x800 - O_NOATIME = 0x40000 - O_NOCTTY = 0x100 - O_NOFOLLOW = 0x20000 - O_NONBLOCK = 0x800 - O_PATH = 0x200000 - O_RSYNC = 0x101000 - O_SYNC = 0x101000 - O_TMPFILE = 0x410000 - O_TRUNC = 0x200 - PARENB = 0x100 - PARODD = 0x200 - PENDIN = 0x4000 - PERF_EVENT_IOC_DISABLE = 0x2401 - PERF_EVENT_IOC_ENABLE = 0x2400 - PERF_EVENT_IOC_ID = 0x80082407 - PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b - PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 - PERF_EVENT_IOC_PERIOD = 0x40082404 - PERF_EVENT_IOC_QUERY_BPF = 0xc008240a - PERF_EVENT_IOC_REFRESH = 0x2402 - PERF_EVENT_IOC_RESET = 0x2403 - PERF_EVENT_IOC_SET_BPF = 0x40042408 - PERF_EVENT_IOC_SET_FILTER = 0x40082406 - PERF_EVENT_IOC_SET_OUTPUT = 0x2405 - PPPIOCATTACH = 0x4004743d - PPPIOCATTCHAN = 0x40047438 - PPPIOCBRIDGECHAN = 0x40047435 - PPPIOCCONNECT = 0x4004743a - PPPIOCDETACH = 0x4004743c - PPPIOCDISCONN = 0x7439 - PPPIOCGASYNCMAP = 0x80047458 - PPPIOCGCHAN = 0x80047437 - PPPIOCGDEBUG = 0x80047441 - PPPIOCGFLAGS = 0x8004745a - PPPIOCGIDLE = 0x8010743f - PPPIOCGIDLE32 = 0x8008743f - PPPIOCGIDLE64 = 0x8010743f - PPPIOCGL2TPSTATS = 0x80487436 - PPPIOCGMRU = 0x80047453 - PPPIOCGRASYNCMAP = 0x80047455 - PPPIOCGUNIT = 0x80047456 - PPPIOCGXASYNCMAP = 0x80207450 - PPPIOCSACTIVE = 0x40107446 - PPPIOCSASYNCMAP = 0x40047457 - PPPIOCSCOMPRESS = 0x4010744d - PPPIOCSDEBUG = 0x40047440 - PPPIOCSFLAGS = 0x40047459 - PPPIOCSMAXCID = 0x40047451 - PPPIOCSMRRU = 0x4004743b - PPPIOCSMRU = 0x40047452 - PPPIOCSNPMODE = 0x4008744b - PPPIOCSPASS = 0x40107447 - PPPIOCSRASYNCMAP = 0x40047454 - PPPIOCSXASYNCMAP = 0x4020744f - PPPIOCUNBRIDGECHAN = 0x7434 - PPPIOCXFERUNIT = 0x744e - PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e - PTRACE_GETFDPIC = 0x21 - PTRACE_GETFDPIC_EXEC = 0x0 - PTRACE_GETFDPIC_INTERP = 0x1 - RLIMIT_AS = 0x9 - RLIMIT_MEMLOCK = 0x8 - RLIMIT_NOFILE = 0x7 - RLIMIT_NPROC = 0x6 - RLIMIT_RSS = 0x5 - RNDADDENTROPY = 0x40085203 - RNDADDTOENTCNT = 0x40045201 - RNDCLEARPOOL = 0x5206 - RNDGETENTCNT = 0x80045200 - RNDGETPOOL = 0x80085202 - RNDRESEEDCRNG = 0x5207 - RNDZAPENTCNT = 0x5204 - RTC_AIE_OFF = 0x7002 - RTC_AIE_ON = 0x7001 - RTC_ALM_READ = 0x80247008 - RTC_ALM_SET = 0x40247007 - RTC_EPOCH_READ = 0x8008700d - RTC_EPOCH_SET = 0x4008700e - RTC_IRQP_READ = 0x8008700b - RTC_IRQP_SET = 0x4008700c - RTC_PARAM_GET = 0x40187013 - RTC_PARAM_SET = 0x40187014 - RTC_PIE_OFF = 0x7006 - RTC_PIE_ON = 0x7005 - RTC_PLL_GET = 0x80207011 - RTC_PLL_SET = 0x40207012 - RTC_RD_TIME = 0x80247009 - RTC_SET_TIME = 0x4024700a - RTC_UIE_OFF = 0x7004 - RTC_UIE_ON = 0x7003 - RTC_VL_CLR = 0x7014 - RTC_VL_READ = 0x80047013 - RTC_WIE_OFF = 0x7010 - RTC_WIE_ON = 0x700f - RTC_WKALM_RD = 0x80287010 - RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e - SCM_TIMESTAMPING = 0x25 - SCM_TIMESTAMPING_OPT_STATS = 0x36 - SCM_TIMESTAMPING_PKTINFO = 0x3a - SCM_TIMESTAMPNS = 0x23 - SCM_TS_OPT_ID = 0x51 - SCM_TXTIME = 0x3d - SCM_WIFI_STATUS = 0x29 - SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 - SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 - SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 - SFD_CLOEXEC = 0x80000 - SFD_NONBLOCK = 0x800 - SIOCATMARK = 0x8905 - SIOCGPGRP = 0x8904 - SIOCGSTAMPNS_NEW = 0x80108907 - SIOCGSTAMP_NEW = 0x80108906 - SIOCINQ = 0x541b - SIOCOUTQ = 0x5411 - SIOCSPGRP = 0x8902 - SOCK_CLOEXEC = 0x80000 - SOCK_DGRAM = 0x2 - SOCK_NONBLOCK = 0x800 - SOCK_STREAM = 0x1 - SOL_SOCKET = 0x1 - SO_ACCEPTCONN = 0x1e - SO_ATTACH_BPF = 0x32 - SO_ATTACH_REUSEPORT_CBPF = 0x33 - SO_ATTACH_REUSEPORT_EBPF = 0x34 - SO_BINDTODEVICE = 0x19 - SO_BINDTOIFINDEX = 0x3e - SO_BPF_EXTENSIONS = 0x30 - SO_BROADCAST = 0x6 - SO_BSDCOMPAT = 0xe - SO_BUF_LOCK = 0x48 - SO_BUSY_POLL = 0x2e - SO_BUSY_POLL_BUDGET = 0x46 - SO_CNX_ADVICE = 0x35 - SO_COOKIE = 0x39 - SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e - SO_DOMAIN = 0x27 - SO_DONTROUTE = 0x5 - SO_ERROR = 0x4 - SO_INCOMING_CPU = 0x31 - SO_INCOMING_NAPI_ID = 0x38 - SO_KEEPALIVE = 0x9 - SO_LINGER = 0xd - SO_LOCK_FILTER = 0x2c - SO_MARK = 0x24 - SO_MAX_PACING_RATE = 0x2f - SO_MEMINFO = 0x37 - SO_NETNS_COOKIE = 0x47 - SO_NOFCS = 0x2b - SO_OOBINLINE = 0xa - SO_PASSCRED = 0x10 - SO_PASSPIDFD = 0x4c - SO_PASSRIGHTS = 0x53 - SO_PASSSEC = 0x22 - SO_PEEK_OFF = 0x2a - SO_PEERCRED = 0x11 - SO_PEERGROUPS = 0x3b - SO_PEERPIDFD = 0x4d - SO_PEERSEC = 0x1f - SO_PREFER_BUSY_POLL = 0x45 - SO_PROTOCOL = 0x26 - SO_RCVBUF = 0x8 - SO_RCVBUFFORCE = 0x21 - SO_RCVLOWAT = 0x12 - SO_RCVMARK = 0x4b - SO_RCVPRIORITY = 0x52 - SO_RCVTIMEO = 0x14 - SO_RCVTIMEO_NEW = 0x42 - SO_RCVTIMEO_OLD = 0x14 - SO_RESERVE_MEM = 0x49 - SO_REUSEADDR = 0x2 - SO_REUSEPORT = 0xf - SO_RXQ_OVFL = 0x28 - SO_SECURITY_AUTHENTICATION = 0x16 - SO_SECURITY_ENCRYPTION_NETWORK = 0x18 - SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 - SO_SELECT_ERR_QUEUE = 0x2d - SO_SNDBUF = 0x7 - SO_SNDBUFFORCE = 0x20 - SO_SNDLOWAT = 0x13 - SO_SNDTIMEO = 0x15 - SO_SNDTIMEO_NEW = 0x43 - SO_SNDTIMEO_OLD = 0x15 - SO_TIMESTAMPING = 0x25 - SO_TIMESTAMPING_NEW = 0x41 - SO_TIMESTAMPING_OLD = 0x25 - SO_TIMESTAMPNS = 0x23 - SO_TIMESTAMPNS_NEW = 0x40 - SO_TIMESTAMPNS_OLD = 0x23 - SO_TIMESTAMP_NEW = 0x3f - SO_TXREHASH = 0x4a - SO_TXTIME = 0x3d - SO_TYPE = 0x3 - SO_WIFI_STATUS = 0x29 - SO_ZEROCOPY = 0x3c - TAB1 = 0x800 - TAB2 = 0x1000 - TAB3 = 0x1800 - TABDLY = 0x1800 - TCFLSH = 0x540b - TCGETA = 0x5405 - TCGETS = 0x5401 - TCGETS2 = 0x802c542a - TCGETX = 0x5432 - TCSAFLUSH = 0x2 - TCSBRK = 0x5409 - TCSBRKP = 0x5425 - TCSETA = 0x5406 - TCSETAF = 0x5408 - TCSETAW = 0x5407 - TCSETS = 0x5402 - TCSETS2 = 0x402c542b - TCSETSF = 0x5404 - TCSETSF2 = 0x402c542d - TCSETSW = 0x5403 - TCSETSW2 = 0x402c542c - TCSETX = 0x5433 - TCSETXF = 0x5434 - TCSETXW = 0x5435 - TCXONC = 0x540a - TFD_CLOEXEC = 0x80000 - TFD_NONBLOCK = 0x800 - TIOCCBRK = 0x5428 - TIOCCONS = 0x541d - TIOCEXCL = 0x540c - TIOCGDEV = 0x80045432 - TIOCGETD = 0x5424 - TIOCGEXCL = 0x80045440 - TIOCGICOUNT = 0x545d - TIOCGISO7816 = 0x80285442 - TIOCGLCKTRMIOS = 0x5456 - TIOCGPGRP = 0x540f - TIOCGPKT = 0x80045438 - TIOCGPTLCK = 0x80045439 - TIOCGPTN = 0x80045430 - TIOCGPTPEER = 0x5441 - TIOCGRS485 = 0x542e - TIOCGSERIAL = 0x541e - TIOCGSID = 0x5429 - TIOCGSOFTCAR = 0x5419 - TIOCGWINSZ = 0x5413 - TIOCINQ = 0x541b - TIOCLINUX = 0x541c - TIOCMBIC = 0x5417 - TIOCMBIS = 0x5416 - TIOCMGET = 0x5415 - TIOCMIWAIT = 0x545c - TIOCMSET = 0x5418 - TIOCM_CAR = 0x40 - TIOCM_CD = 0x40 - TIOCM_CTS = 0x20 - TIOCM_DSR = 0x100 - TIOCM_RI = 0x80 - TIOCM_RNG = 0x80 - TIOCM_SR = 0x10 - TIOCM_ST = 0x8 - TIOCNOTTY = 0x5422 - TIOCNXCL = 0x540d - TIOCOUTQ = 0x5411 - TIOCPKT = 0x5420 - TIOCSBRK = 0x5427 - TIOCSCTTY = 0x540e - TIOCSERCONFIG = 0x5453 - TIOCSERGETLSR = 0x5459 - TIOCSERGETMULTI = 0x545a - TIOCSERGSTRUCT = 0x5458 - TIOCSERGWILD = 0x5454 - TIOCSERSETMULTI = 0x545b - TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 - TIOCSETD = 0x5423 - TIOCSIG = 0x40045436 - TIOCSISO7816 = 0xc0285443 - TIOCSLCKTRMIOS = 0x5457 - TIOCSPGRP = 0x5410 - TIOCSPTLCK = 0x40045431 - TIOCSRS485 = 0x542f - TIOCSSERIAL = 0x541f - TIOCSSOFTCAR = 0x541a - TIOCSTI = 0x5412 - TIOCSWINSZ = 0x5414 - TIOCVHANGUP = 0x5437 - TOSTOP = 0x100 - TUNATTACHFILTER = 0x401054d5 - TUNDETACHFILTER = 0x401054d6 - TUNGETDEVNETNS = 0x54e3 - TUNGETFEATURES = 0x800454cf - TUNGETFILTER = 0x801054db - TUNGETIFF = 0x800454d2 - TUNGETSNDBUF = 0x800454d3 - TUNGETVNETBE = 0x800454df - TUNGETVNETHDRSZ = 0x800454d7 - TUNGETVNETLE = 0x800454dd - TUNSETCARRIER = 0x400454e2 - TUNSETDEBUG = 0x400454c9 - TUNSETFILTEREBPF = 0x800454e1 - TUNSETGROUP = 0x400454ce - TUNSETIFF = 0x400454ca - TUNSETIFINDEX = 0x400454da - TUNSETLINK = 0x400454cd - TUNSETNOCSUM = 0x400454c8 - TUNSETOFFLOAD = 0x400454d0 - TUNSETOWNER = 0x400454cc - TUNSETPERSIST = 0x400454cb - TUNSETQUEUE = 0x400454d9 - TUNSETSNDBUF = 0x400454d4 - TUNSETSTEERINGEBPF = 0x800454e0 - TUNSETTXFILTER = 0x400454d1 - TUNSETVNETBE = 0x400454de - TUNSETVNETHDRSZ = 0x400454d8 - TUNSETVNETLE = 0x400454dc - UBI_IOCATT = 0x40186f40 - UBI_IOCDET = 0x40046f41 - UBI_IOCEBCH = 0x40044f02 - UBI_IOCEBER = 0x40044f01 - UBI_IOCEBISMAP = 0x80044f05 - UBI_IOCEBMAP = 0x40084f03 - UBI_IOCEBUNMAP = 0x40044f04 - UBI_IOCMKVOL = 0x40986f00 - UBI_IOCRMVOL = 0x40046f01 - UBI_IOCRNVOL = 0x51106f03 - UBI_IOCRPEB = 0x40046f04 - UBI_IOCRSVOL = 0x400c6f02 - UBI_IOCSETVOLPROP = 0x40104f06 - UBI_IOCSPEB = 0x40046f05 - UBI_IOCVOLCRBLK = 0x40804f07 - UBI_IOCVOLRMBLK = 0x4f08 - UBI_IOCVOLUP = 0x40084f00 - VDISCARD = 0xd - VEOF = 0x4 - VEOL = 0xb - VEOL2 = 0x10 - VMIN = 0x6 - VREPRINT = 0xc - VSTART = 0x8 - VSTOP = 0x9 - VSUSP = 0xa - VSWTC = 0x7 - VT1 = 0x4000 - VTDLY = 0x4000 - VTIME = 0x5 - VWERASE = 0xe - WDIOC_GETBOOTSTATUS = 0x80045702 - WDIOC_GETPRETIMEOUT = 0x80045709 - WDIOC_GETSTATUS = 0x80045701 - WDIOC_GETSUPPORT = 0x80285700 - WDIOC_GETTEMP = 0x80045703 - WDIOC_GETTIMELEFT = 0x8004570a - WDIOC_GETTIMEOUT = 0x80045707 - WDIOC_KEEPALIVE = 0x80045705 - WDIOC_SETOPTIONS = 0x80045704 - WORDSIZE = 0x40 - XCASE = 0x4 - XTABS = 0x1800 - _HIDIOCGRAWNAME = 0x80804804 - _HIDIOCGRAWPHYS = 0x80404805 - _HIDIOCGRAWUNIQ = 0x80404808 + B1000000 = 0x1008 + B115200 = 0x1002 + B1152000 = 0x1009 + B1500000 = 0x100a + B2000000 = 0x100b + B230400 = 0x1003 + B2500000 = 0x100c + B3000000 = 0x100d + B3500000 = 0x100e + B4000000 = 0x100f + B460800 = 0x1004 + B500000 = 0x1005 + B57600 = 0x1001 + B576000 = 0x1006 + B921600 = 0x1007 + BLKALIGNOFF = 0x127a + BLKBSZGET = 0x80081270 + BLKBSZSET = 0x40081271 + BLKDISCARD = 0x1277 + BLKDISCARDZEROES = 0x127c + BLKFLSBUF = 0x1261 + BLKFRAGET = 0x1265 + BLKFRASET = 0x1264 + BLKGETDISKSEQ = 0x80081280 + BLKGETSIZE = 0x1260 + BLKGETSIZE64 = 0x80081272 + BLKIOMIN = 0x1278 + BLKIOOPT = 0x1279 + BLKPBSZGET = 0x127b + BLKRAGET = 0x1263 + BLKRASET = 0x1262 + BLKROGET = 0x125e + BLKROSET = 0x125d + BLKROTATIONAL = 0x127e + BLKRRPART = 0x125f + BLKSECDISCARD = 0x127d + BLKSECTGET = 0x1267 + BLKSECTSET = 0x1266 + BLKSSZGET = 0x1268 + BLKZEROOUT = 0x127f + BOTHER = 0x1000 + BS1 = 0x2000 + BSDLY = 0x2000 + CBAUD = 0x100f + CBAUDEX = 0x1000 + CIBAUD = 0x100f0000 + CLOCAL = 0x800 + CR1 = 0x200 + CR2 = 0x400 + CR3 = 0x600 + CRDLY = 0x600 + CREAD = 0x80 + CS6 = 0x10 + CS7 = 0x20 + CS8 = 0x30 + CSIZE = 0x30 + CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 + ECCGETLAYOUT = 0x81484d11 + ECCGETSTATS = 0x80104d12 + ECHOCTL = 0x200 + ECHOE = 0x10 + ECHOK = 0x20 + ECHOKE = 0x800 + ECHONL = 0x40 + ECHOPRT = 0x400 + EFD_CLOEXEC = 0x80000 + EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 + EPOLL_CLOEXEC = 0x80000 + EXTPROC = 0x10000 + FF1 = 0x8000 + FFDLY = 0x8000 + FICLONE = 0x40049409 + FICLONERANGE = 0x4020940d + FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 + FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b + FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 + FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 + FS_IOC_SETFLAGS = 0x40086602 + FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 + F_GETLK = 0x5 + F_GETLK64 = 0x5 + F_GETOWN = 0x9 + F_RDLCK = 0x0 + F_SETLK = 0x6 + F_SETLK64 = 0x6 + F_SETLKW = 0x7 + F_SETLKW64 = 0x7 + F_SETOWN = 0x8 + F_UNLCK = 0x2 + F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 + HIDIOCREVOKE = 0x4004480d + HUPCL = 0x400 + ICANON = 0x2 + IEXTEN = 0x8000 + IN_CLOEXEC = 0x80000 + IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 + IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 + ISIG = 0x1 + IUCLC = 0x200 + IXOFF = 0x1000 + IXON = 0x400 + MAP_ANON = 0x20 + MAP_ANONYMOUS = 0x20 + MAP_DENYWRITE = 0x800 + MAP_EXECUTABLE = 0x1000 + MAP_GROWSDOWN = 0x100 + MAP_HUGETLB = 0x40000 + MAP_LOCKED = 0x2000 + MAP_NONBLOCK = 0x10000 + MAP_NORESERVE = 0x4000 + MAP_POPULATE = 0x8000 + MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 + MCL_CURRENT = 0x1 + MCL_FUTURE = 0x2 + MCL_ONFAULT = 0x4 + MEMERASE = 0x40084d02 + MEMERASE64 = 0x40104d14 + MEMGETBADBLOCK = 0x40084d0b + MEMGETINFO = 0x80204d01 + MEMGETOOBSEL = 0x80c84d0a + MEMGETREGIONCOUNT = 0x80044d07 + MEMISLOCKED = 0x80084d17 + MEMLOCK = 0x40084d05 + MEMREAD = 0xc0404d1a + MEMREADOOB = 0xc0104d04 + MEMSETBADBLOCK = 0x40084d0c + MEMUNLOCK = 0x40084d06 + MEMWRITEOOB = 0xc0104d03 + MTDFILEMODE = 0x4d13 + NFDBITS = 0x40 + NLDLY = 0x100 + NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d + NS_GET_MNTNS_ID = 0x8008b705 + NS_GET_NSTYPE = 0xb703 + NS_GET_OWNER_UID = 0xb704 + NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 + NS_GET_USERNS = 0xb701 + OLCUC = 0x2 + ONLCR = 0x4 + OTPERASE = 0x400c4d19 + OTPGETREGIONCOUNT = 0x40044d0e + OTPGETREGIONINFO = 0x400c4d0f + OTPLOCK = 0x800c4d10 + OTPSELECT = 0x80044d0d + O_APPEND = 0x400 + O_ASYNC = 0x2000 + O_CLOEXEC = 0x80000 + O_CREAT = 0x40 + O_DIRECT = 0x4000 + O_DIRECTORY = 0x10000 + O_DSYNC = 0x1000 + O_EXCL = 0x80 + O_FSYNC = 0x101000 + O_LARGEFILE = 0x0 + O_NDELAY = 0x800 + O_NOATIME = 0x40000 + O_NOCTTY = 0x100 + O_NOFOLLOW = 0x20000 + O_NONBLOCK = 0x800 + O_PATH = 0x200000 + O_RSYNC = 0x101000 + O_SYNC = 0x101000 + O_TMPFILE = 0x410000 + O_TRUNC = 0x200 + PARENB = 0x100 + PARODD = 0x200 + PENDIN = 0x4000 + PERF_EVENT_IOC_DISABLE = 0x2401 + PERF_EVENT_IOC_ENABLE = 0x2400 + PERF_EVENT_IOC_ID = 0x80082407 + PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b + PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 + PERF_EVENT_IOC_PERIOD = 0x40082404 + PERF_EVENT_IOC_QUERY_BPF = 0xc008240a + PERF_EVENT_IOC_REFRESH = 0x2402 + PERF_EVENT_IOC_RESET = 0x2403 + PERF_EVENT_IOC_SET_BPF = 0x40042408 + PERF_EVENT_IOC_SET_FILTER = 0x40082406 + PERF_EVENT_IOC_SET_OUTPUT = 0x2405 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 + PPPIOCXFERUNIT = 0x744e + PR_SET_PTRACER_ANY = 0xffffffffffffffff + PTP_CLOCK_GETCAPS = 0x80503d01 + PTP_CLOCK_GETCAPS2 = 0x80503d0a + PTP_ENABLE_PPS = 0x40043d04 + PTP_ENABLE_PPS2 = 0x40043d0d + PTP_EXTTS_REQUEST = 0x40103d02 + PTP_EXTTS_REQUEST2 = 0x40103d0b + PTP_MASK_CLEAR_ALL = 0x3d13 + PTP_MASK_EN_SINGLE = 0x40043d14 + PTP_PEROUT_REQUEST = 0x40383d03 + PTP_PEROUT_REQUEST2 = 0x40383d0c + PTP_PIN_SETFUNC = 0x40603d07 + PTP_PIN_SETFUNC2 = 0x40603d10 + PTP_SYS_OFFSET = 0x43403d05 + PTP_SYS_OFFSET2 = 0x43403d0e + PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_BIT = 0x2 + PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_STATE = 0x4 + PTRACE_CFI_BRANCH_LANDING_PAD_EN_BIT = 0x0 + PTRACE_CFI_BRANCH_LANDING_PAD_EN_STATE = 0x1 + PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_BIT = 0x1 + PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_STATE = 0x2 + PTRACE_CFI_SHADOW_STACK_EN_BIT = 0x3 + PTRACE_CFI_SHADOW_STACK_EN_STATE = 0x8 + PTRACE_CFI_SHADOW_STACK_LOCK_BIT = 0x4 + PTRACE_CFI_SHADOW_STACK_LOCK_STATE = 0x10 + PTRACE_CFI_SHADOW_STACK_PTR_BIT = 0x5 + PTRACE_CFI_SHADOW_STACK_PTR_STATE = 0x20 + PTRACE_CFI_STATE_INVALID_MASK = 0xffffffffffffffc0 + PTRACE_GETFDPIC = 0x21 + PTRACE_GETFDPIC_EXEC = 0x0 + PTRACE_GETFDPIC_INTERP = 0x1 + RLIMIT_AS = 0x9 + RLIMIT_MEMLOCK = 0x8 + RLIMIT_NOFILE = 0x7 + RLIMIT_NPROC = 0x6 + RLIMIT_RSS = 0x5 + RNDADDENTROPY = 0x40085203 + RNDADDTOENTCNT = 0x40045201 + RNDCLEARPOOL = 0x5206 + RNDGETENTCNT = 0x80045200 + RNDGETPOOL = 0x80085202 + RNDRESEEDCRNG = 0x5207 + RNDZAPENTCNT = 0x5204 + RTC_AIE_OFF = 0x7002 + RTC_AIE_ON = 0x7001 + RTC_ALM_READ = 0x80247008 + RTC_ALM_SET = 0x40247007 + RTC_EPOCH_READ = 0x8008700d + RTC_EPOCH_SET = 0x4008700e + RTC_IRQP_READ = 0x8008700b + RTC_IRQP_SET = 0x4008700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 + RTC_PIE_OFF = 0x7006 + RTC_PIE_ON = 0x7005 + RTC_PLL_GET = 0x80207011 + RTC_PLL_SET = 0x40207012 + RTC_RD_TIME = 0x80247009 + RTC_SET_TIME = 0x4024700a + RTC_UIE_OFF = 0x7004 + RTC_UIE_ON = 0x7003 + RTC_VL_CLR = 0x7014 + RTC_VL_READ = 0x80047013 + RTC_WIE_OFF = 0x7010 + RTC_WIE_ON = 0x700f + RTC_WKALM_RD = 0x80287010 + RTC_WKALM_SET = 0x4028700f + SCM_DEVMEM_DMABUF = 0x4f + SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 + SCM_TIMESTAMPING = 0x25 + SCM_TIMESTAMPING_OPT_STATS = 0x36 + SCM_TIMESTAMPING_PKTINFO = 0x3a + SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 + SCM_TXTIME = 0x3d + SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 + SFD_CLOEXEC = 0x80000 + SFD_NONBLOCK = 0x800 + SIOCATMARK = 0x8905 + SIOCGPGRP = 0x8904 + SIOCGSTAMPNS_NEW = 0x80108907 + SIOCGSTAMP_NEW = 0x80108906 + SIOCINQ = 0x541b + SIOCOUTQ = 0x5411 + SIOCSPGRP = 0x8902 + SOCK_CLOEXEC = 0x80000 + SOCK_DGRAM = 0x2 + SOCK_NONBLOCK = 0x800 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0x1 + SO_ACCEPTCONN = 0x1e + SO_ATTACH_BPF = 0x32 + SO_ATTACH_REUSEPORT_CBPF = 0x33 + SO_ATTACH_REUSEPORT_EBPF = 0x34 + SO_BINDTODEVICE = 0x19 + SO_BINDTOIFINDEX = 0x3e + SO_BPF_EXTENSIONS = 0x30 + SO_BROADCAST = 0x6 + SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 + SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 + SO_CNX_ADVICE = 0x35 + SO_COOKIE = 0x39 + SO_DETACH_REUSEPORT_BPF = 0x44 + SO_DEVMEM_DMABUF = 0x4f + SO_DEVMEM_DONTNEED = 0x50 + SO_DEVMEM_LINEAR = 0x4e + SO_DOMAIN = 0x27 + SO_DONTROUTE = 0x5 + SO_ERROR = 0x4 + SO_INCOMING_CPU = 0x31 + SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 + SO_KEEPALIVE = 0x9 + SO_LINGER = 0xd + SO_LOCK_FILTER = 0x2c + SO_MARK = 0x24 + SO_MAX_PACING_RATE = 0x2f + SO_MEMINFO = 0x37 + SO_NETNS_COOKIE = 0x47 + SO_NOFCS = 0x2b + SO_OOBINLINE = 0xa + SO_PASSCRED = 0x10 + SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 + SO_PASSSEC = 0x22 + SO_PEEK_OFF = 0x2a + SO_PEERCRED = 0x11 + SO_PEERGROUPS = 0x3b + SO_PEERPIDFD = 0x4d + SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 + SO_PROTOCOL = 0x26 + SO_RCVBUF = 0x8 + SO_RCVBUFFORCE = 0x21 + SO_RCVLOWAT = 0x12 + SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 + SO_RCVTIMEO = 0x14 + SO_RCVTIMEO_NEW = 0x42 + SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 + SO_REUSEADDR = 0x2 + SO_REUSEPORT = 0xf + SO_RXQ_OVFL = 0x28 + SO_SECURITY_AUTHENTICATION = 0x16 + SO_SECURITY_ENCRYPTION_NETWORK = 0x18 + SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 + SO_SELECT_ERR_QUEUE = 0x2d + SO_SNDBUF = 0x7 + SO_SNDBUFFORCE = 0x20 + SO_SNDLOWAT = 0x13 + SO_SNDTIMEO = 0x15 + SO_SNDTIMEO_NEW = 0x43 + SO_SNDTIMEO_OLD = 0x15 + SO_TIMESTAMPING = 0x25 + SO_TIMESTAMPING_NEW = 0x41 + SO_TIMESTAMPING_OLD = 0x25 + SO_TIMESTAMPNS = 0x23 + SO_TIMESTAMPNS_NEW = 0x40 + SO_TIMESTAMPNS_OLD = 0x23 + SO_TIMESTAMP_NEW = 0x3f + SO_TXREHASH = 0x4a + SO_TXTIME = 0x3d + SO_TYPE = 0x3 + SO_WIFI_STATUS = 0x29 + SO_ZEROCOPY = 0x3c + TAB1 = 0x800 + TAB2 = 0x1000 + TAB3 = 0x1800 + TABDLY = 0x1800 + TCFLSH = 0x540b + TCGETA = 0x5405 + TCGETS = 0x5401 + TCGETS2 = 0x802c542a + TCGETX = 0x5432 + TCSAFLUSH = 0x2 + TCSBRK = 0x5409 + TCSBRKP = 0x5425 + TCSETA = 0x5406 + TCSETAF = 0x5408 + TCSETAW = 0x5407 + TCSETS = 0x5402 + TCSETS2 = 0x402c542b + TCSETSF = 0x5404 + TCSETSF2 = 0x402c542d + TCSETSW = 0x5403 + TCSETSW2 = 0x402c542c + TCSETX = 0x5433 + TCSETXF = 0x5434 + TCSETXW = 0x5435 + TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 + TIOCCBRK = 0x5428 + TIOCCONS = 0x541d + TIOCEXCL = 0x540c + TIOCGDEV = 0x80045432 + TIOCGETD = 0x5424 + TIOCGEXCL = 0x80045440 + TIOCGICOUNT = 0x545d + TIOCGISO7816 = 0x80285442 + TIOCGLCKTRMIOS = 0x5456 + TIOCGPGRP = 0x540f + TIOCGPKT = 0x80045438 + TIOCGPTLCK = 0x80045439 + TIOCGPTN = 0x80045430 + TIOCGPTPEER = 0x5441 + TIOCGRS485 = 0x542e + TIOCGSERIAL = 0x541e + TIOCGSID = 0x5429 + TIOCGSOFTCAR = 0x5419 + TIOCGWINSZ = 0x5413 + TIOCINQ = 0x541b + TIOCLINUX = 0x541c + TIOCMBIC = 0x5417 + TIOCMBIS = 0x5416 + TIOCMGET = 0x5415 + TIOCMIWAIT = 0x545c + TIOCMSET = 0x5418 + TIOCM_CAR = 0x40 + TIOCM_CD = 0x40 + TIOCM_CTS = 0x20 + TIOCM_DSR = 0x100 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x5422 + TIOCNXCL = 0x540d + TIOCOUTQ = 0x5411 + TIOCPKT = 0x5420 + TIOCSBRK = 0x5427 + TIOCSCTTY = 0x540e + TIOCSERCONFIG = 0x5453 + TIOCSERGETLSR = 0x5459 + TIOCSERGETMULTI = 0x545a + TIOCSERGSTRUCT = 0x5458 + TIOCSERGWILD = 0x5454 + TIOCSERSETMULTI = 0x545b + TIOCSERSWILD = 0x5455 + TIOCSER_TEMT = 0x1 + TIOCSETD = 0x5423 + TIOCSIG = 0x40045436 + TIOCSISO7816 = 0xc0285443 + TIOCSLCKTRMIOS = 0x5457 + TIOCSPGRP = 0x5410 + TIOCSPTLCK = 0x40045431 + TIOCSRS485 = 0x542f + TIOCSSERIAL = 0x541f + TIOCSSOFTCAR = 0x541a + TIOCSTI = 0x5412 + TIOCSWINSZ = 0x5414 + TIOCVHANGUP = 0x5437 + TOSTOP = 0x100 + TUNATTACHFILTER = 0x401054d5 + TUNDETACHFILTER = 0x401054d6 + TUNGETDEVNETNS = 0x54e3 + TUNGETFEATURES = 0x800454cf + TUNGETFILTER = 0x801054db + TUNGETIFF = 0x800454d2 + TUNGETSNDBUF = 0x800454d3 + TUNGETVNETBE = 0x800454df + TUNGETVNETHDRSZ = 0x800454d7 + TUNGETVNETLE = 0x800454dd + TUNSETCARRIER = 0x400454e2 + TUNSETDEBUG = 0x400454c9 + TUNSETFILTEREBPF = 0x800454e1 + TUNSETGROUP = 0x400454ce + TUNSETIFF = 0x400454ca + TUNSETIFINDEX = 0x400454da + TUNSETLINK = 0x400454cd + TUNSETNOCSUM = 0x400454c8 + TUNSETOFFLOAD = 0x400454d0 + TUNSETOWNER = 0x400454cc + TUNSETPERSIST = 0x400454cb + TUNSETQUEUE = 0x400454d9 + TUNSETSNDBUF = 0x400454d4 + TUNSETSTEERINGEBPF = 0x800454e0 + TUNSETTXFILTER = 0x400454d1 + TUNSETVNETBE = 0x400454de + TUNSETVNETHDRSZ = 0x400454d8 + TUNSETVNETLE = 0x400454dc + UBI_IOCATT = 0x40186f40 + UBI_IOCDET = 0x40046f41 + UBI_IOCEBCH = 0x40044f02 + UBI_IOCEBER = 0x40044f01 + UBI_IOCEBISMAP = 0x80044f05 + UBI_IOCEBMAP = 0x40084f03 + UBI_IOCEBUNMAP = 0x40044f04 + UBI_IOCMKVOL = 0x40986f00 + UBI_IOCRMVOL = 0x40046f01 + UBI_IOCRNVOL = 0x51106f03 + UBI_IOCRPEB = 0x40046f04 + UBI_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCSPEB = 0x40046f05 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 + VDISCARD = 0xd + VEOF = 0x4 + VEOL = 0xb + VEOL2 = 0x10 + VMIN = 0x6 + VREPRINT = 0xc + VSTART = 0x8 + VSTOP = 0x9 + VSUSP = 0xa + VSWTC = 0x7 + VT1 = 0x4000 + VTDLY = 0x4000 + VTIME = 0x5 + VWERASE = 0xe + WDIOC_GETBOOTSTATUS = 0x80045702 + WDIOC_GETPRETIMEOUT = 0x80045709 + WDIOC_GETSTATUS = 0x80045701 + WDIOC_GETSUPPORT = 0x80285700 + WDIOC_GETTEMP = 0x80045703 + WDIOC_GETTIMELEFT = 0x8004570a + WDIOC_GETTIMEOUT = 0x80045707 + WDIOC_KEEPALIVE = 0x80045705 + WDIOC_SETOPTIONS = 0x80045704 + WORDSIZE = 0x40 + XCASE = 0x4 + XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors @@ -585,6 +601,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -808,7 +826,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 64347eb35..6e87bd659 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -367,6 +368,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -414,6 +416,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -657,6 +660,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -880,7 +885,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 7d7191171..7e2b2e8a6 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -161,6 +161,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -358,6 +359,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x58 SCM_DEVMEM_LINEAR = 0x57 + SCM_INQ = 0x5d SCM_TIMESTAMPING = 0x23 SCM_TIMESTAMPING_OPT_STATS = 0x38 SCM_TIMESTAMPING_PKTINFO = 0x3c @@ -453,6 +455,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x33 SO_INCOMING_NAPI_ID = 0x3a + SO_INQ = 0x5d SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x28 @@ -694,6 +697,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x27) EDOTDOT = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) + EFSBADCRC = syscall.Errno(0x4c) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EHWPOISON = syscall.Errno(0x87) @@ -921,7 +926,7 @@ var errorList = [...]struct { {114, "ELIBACC", "can not access a needed shared library"}, {115, "ENOTUNIQ", "name not unique on network"}, {116, "ERESTART", "interrupted system call should be restarted"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 8935d10a3..80f40e401 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -1785,7 +1785,7 @@ func writev(fd int, iovs []Iovec) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { +func preadvSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -1802,7 +1802,7 @@ func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err er // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { +func pwritevSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -1819,7 +1819,7 @@ func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { +func preadv2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -1836,7 +1836,7 @@ func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { +func pwritev2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -2241,8 +2241,8 @@ func Mseal(b []byte, flags uint) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setMemPolicy(mode int, mask *CPUSet, size int) (err error) { - _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), uintptr(size)) +func setMemPolicy(mode int, mask unsafe.Pointer, size uintptr) (err error) { + _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(mask), uintptr(size)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 1851df14e..6487475f0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), uintptr(offset>>32), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), uintptr(offset>>32), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 0b43c6936..f10201dac 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_readv_trampoline_addr(SB)/4, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_writev_trampoline_addr(SB)/4, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_preadv_trampoline_addr(SB)/4, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_pwritev_trampoline_addr(SB)/4, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index e1ec0dbe4..50980475d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 880c6d6e3..9de2cbaa4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index 7c8452a63..33c9c3a43 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), 0, uintptr(offset), uintptr(offset>>32)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), 0, uintptr(offset), uintptr(offset>>32)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index b8ef95b0f..c6b9175a6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_readv_trampoline_addr(SB)/4, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_writev_trampoline_addr(SB)/4, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_preadv_trampoline_addr(SB)/4, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_pwritev_trampoline_addr(SB)/4, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 2ffdf861f..d3410262e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index 2af3b5c76..1be10bb45 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 1da08d526..dea19d54e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index b7a251353..a9fec24d9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 6e85b0aac..436efb586 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index f15dadf05..441ed4e40 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -597,6 +597,30 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_readv(SB) + RET +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_writev(SB) + RET +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_preadv(SB) + RET +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_pwritev(SB) + RET +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_read(SB) RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 28b487df2..d801e4b4e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index 1e7f321e4..b15cc0174 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index aca56ee49..49d1b8803 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -463,4 +463,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 2ea1ef58c..f11f1de77 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -342,6 +342,7 @@ const ( SYS_IO_PGETEVENTS = 333 SYS_RSEQ = 334 SYS_URETPROBE = 335 + SYS_UPROBE = 336 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 @@ -386,4 +387,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index d22c8af31..bad740b79 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -427,4 +427,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 5ee264ae9..fe646d18e 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -330,4 +330,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index f9f03ebf5..4362f6d55 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -306,6 +306,7 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 @@ -326,4 +327,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 87c2118e8..b63d155ae 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -447,4 +447,8 @@ const ( SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 SYS_OPEN_TREE_ATTR = 4467 + SYS_FILE_GETATTR = 4468 + SYS_FILE_SETATTR = 4469 + SYS_LISTNS = 4470 + SYS_RSEQ_SLICE_YIELD = 4471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 391ad102f..435d43319 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -377,4 +377,8 @@ const ( SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 SYS_OPEN_TREE_ATTR = 5467 + SYS_FILE_GETATTR = 5468 + SYS_FILE_SETATTR = 5469 + SYS_LISTNS = 5470 + SYS_RSEQ_SLICE_YIELD = 5471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 565615775..dcc0468d6 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -377,4 +377,8 @@ const ( SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 SYS_OPEN_TREE_ATTR = 5467 + SYS_FILE_GETATTR = 5468 + SYS_FILE_SETATTR = 5469 + SYS_LISTNS = 5470 + SYS_RSEQ_SLICE_YIELD = 5471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 0482b52e3..b96f85ebd 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -447,4 +447,8 @@ const ( SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 SYS_OPEN_TREE_ATTR = 4467 + SYS_FILE_GETATTR = 4468 + SYS_FILE_SETATTR = 4469 + SYS_LISTNS = 4470 + SYS_RSEQ_SLICE_YIELD = 4471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 71806f08f..bffa2bd1e 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -454,4 +454,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index e35a71058..57bfc6b26 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -426,4 +426,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 2aea47670..750f706d5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -426,4 +426,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 6c9bb4e56..303ccbf46 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -331,4 +331,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 680bc9915..5e5dd4ccb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -392,4 +392,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 620f27105..f7c4fb3df 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -374,6 +374,7 @@ const ( SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 + SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 @@ -405,4 +406,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 45476a73c..d11d5b96a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -18,6 +18,11 @@ type ( _C_long_long int64 ) +type KernelTimespec struct { + Sec int64 + Nsec int64 +} + type ItimerSpec struct { Interval Timespec Value Timespec @@ -521,6 +526,14 @@ type TCPInfo struct { Total_rto uint16 Total_rto_recoveries uint16 Total_rto_time uint32 + Received_ce uint32 + Delivered_e1_bytes uint32 + Delivered_e0_bytes uint32 + Delivered_ce_bytes uint32 + Received_e1_bytes uint32 + Received_e0_bytes uint32 + Received_ce_bytes uint32 + _ [4]byte } type TCPVegasInfo struct { @@ -586,7 +599,7 @@ const ( SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc - SizeofTCPInfo = 0xf8 + SizeofTCPInfo = 0x118 SizeofTCPCCInfo = 0x14 SizeofCanFilter = 0x8 SizeofTCPRepairOpt = 0x8 @@ -1324,7 +1337,7 @@ const ( PERF_RECORD_CGROUP = 0x13 PERF_RECORD_TEXT_POKE = 0x14 PERF_RECORD_AUX_OUTPUT_HW_ID = 0x15 - PERF_RECORD_MAX = 0x16 + PERF_RECORD_MAX = 0x17 PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0x0 PERF_RECORD_KSYMBOL_TYPE_BPF = 0x1 PERF_RECORD_KSYMBOL_TYPE_OOL = 0x2 @@ -3566,7 +3579,7 @@ const ( DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES = 0xae DEVLINK_ATTR_NESTED_DEVLINK = 0xaf DEVLINK_ATTR_SELFTESTS = 0xb0 - DEVLINK_ATTR_MAX = 0xb3 + DEVLINK_ATTR_MAX = 0xb7 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 @@ -3888,7 +3901,7 @@ const ( ETHTOOL_MSG_PHY_GET = 0x2d ETHTOOL_MSG_TSCONFIG_GET = 0x2e ETHTOOL_MSG_TSCONFIG_SET = 0x2f - ETHTOOL_MSG_USER_MAX = 0x2f + ETHTOOL_MSG_USER_MAX = 0x33 ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3938,7 +3951,7 @@ const ( ETHTOOL_MSG_PHY_NTF = 0x2e ETHTOOL_MSG_TSCONFIG_GET_REPLY = 0x2f ETHTOOL_MSG_TSCONFIG_SET_REPLY = 0x30 - ETHTOOL_MSG_KERNEL_MAX = 0x30 + ETHTOOL_MSG_KERNEL_MAX = 0x36 ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 ETHTOOL_FLAG_OMIT_REPLY = 0x2 ETHTOOL_FLAG_STATS = 0x4 @@ -4867,7 +4880,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x151 + NL80211_ATTR_MAX = 0x15c NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143 @@ -5082,12 +5095,12 @@ const ( NL80211_ATTR_WOWLAN_TRIGGERS = 0x75 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED = 0x76 NL80211_ATTR_WPA_VERSIONS = 0x4b - NL80211_AUTHTYPE_AUTOMATIC = 0x8 + NL80211_AUTHTYPE_AUTOMATIC = 0x9 NL80211_AUTHTYPE_FILS_PK = 0x7 NL80211_AUTHTYPE_FILS_SK = 0x5 NL80211_AUTHTYPE_FILS_SK_PFS = 0x6 NL80211_AUTHTYPE_FT = 0x2 - NL80211_AUTHTYPE_MAX = 0x7 + NL80211_AUTHTYPE_MAX = 0x8 NL80211_AUTHTYPE_NETWORK_EAP = 0x3 NL80211_AUTHTYPE_OPEN_SYSTEM = 0x0 NL80211_AUTHTYPE_SAE = 0x4 @@ -5120,7 +5133,7 @@ const ( NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY = 0x3 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE = 0x5 NL80211_BAND_IFTYPE_ATTR_IFTYPES = 0x1 - NL80211_BAND_IFTYPE_ATTR_MAX = 0xb + NL80211_BAND_IFTYPE_ATTR_MAX = 0xd NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS = 0x7 NL80211_BAND_LC = 0x5 NL80211_BAND_S1GHZ = 0x4 @@ -5255,7 +5268,7 @@ const ( NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d NL80211_CMD_LINKS_REMOVED = 0x9a - NL80211_CMD_MAX = 0x9d + NL80211_CMD_MAX = 0x9f NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 @@ -5501,7 +5514,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x22 + NL80211_FREQUENCY_ATTR_MAX = 0x27 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5766,7 +5779,7 @@ const ( NL80211_PMSR_FTM_CAPA_ATTR_ASAP = 0x1 NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS = 0x6 NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT = 0x7 - NL80211_PMSR_FTM_CAPA_ATTR_MAX = 0xa + NL80211_PMSR_FTM_CAPA_ATTR_MAX = 0x12 NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST = 0x8 NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP = 0x2 NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED = 0xa @@ -5788,7 +5801,7 @@ const ( NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD = 0x4 NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST = 0x6 NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK = 0xc - NL80211_PMSR_FTM_REQ_ATTR_MAX = 0xd + NL80211_PMSR_FTM_REQ_ATTR_MAX = 0xe NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED = 0xb NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP = 0x3 NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES = 0x7 @@ -5806,7 +5819,7 @@ const ( NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON = 0x1 NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST = 0x8 NL80211_PMSR_FTM_RESP_ATTR_LCI = 0x13 - NL80211_PMSR_FTM_RESP_ATTR_MAX = 0x15 + NL80211_PMSR_FTM_RESP_ATTR_MAX = 0x16 NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP = 0x6 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS = 0x3 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES = 0x4 @@ -5913,7 +5926,7 @@ const ( NL80211_RATE_INFO_HE_RU_ALLOC_52 = 0x1 NL80211_RATE_INFO_HE_RU_ALLOC_996 = 0x5 NL80211_RATE_INFO_HE_RU_ALLOC = 0x11 - NL80211_RATE_INFO_MAX = 0x1d + NL80211_RATE_INFO_MAX = 0x20 NL80211_RATE_INFO_MCS = 0x2 NL80211_RATE_INFO_S1G_MCS = 0x17 NL80211_RATE_INFO_S1G_NSS = 0x18 @@ -6167,7 +6180,7 @@ const ( NL80211_TXRATE_HT = 0x2 NL80211_TXRATE_LEGACY = 0x1 NL80211_TX_RATE_LIMITED = 0x1 - NL80211_TXRATE_MAX = 0x7 + NL80211_TXRATE_MAX = 0xa NL80211_TXRATE_MCS = 0x2 NL80211_TXRATE_VHT = 0x3 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT = 0x1 @@ -6183,7 +6196,7 @@ const ( NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE = 0x2 NL80211_WIPHY_RADIO_ATTR_INDEX = 0x1 NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION = 0x3 - NL80211_WIPHY_RADIO_ATTR_MAX = 0x4 + NL80211_WIPHY_RADIO_ATTR_MAX = 0x5 NL80211_WIPHY_RADIO_FREQ_ATTR_END = 0x2 NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = 0x2 NL80211_WIPHY_RADIO_FREQ_ATTR_START = 0x1 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index 485f2d3a1..97ef790de 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -354,6 +354,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index ecbd1ad8b..90b50da68 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -367,6 +367,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 02f0463a4..acda13685 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -345,6 +345,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 6f4d400d2..ef7a99e1f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -346,6 +346,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index cd532cfa5..966063dfc 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -347,6 +347,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 413362085..dc53b20b7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -350,6 +350,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index eaa37eb71..9ad0aa8c3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -349,6 +349,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 98ae6a1e4..29d55493d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -349,6 +349,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index cae196159..a4d9e1584 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -350,6 +350,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 6ce3b4e02..f8a297771 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -357,6 +357,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index c7429c6a1..4158d6c4e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -356,6 +356,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 4bf4baf4c..1035af49f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -356,6 +356,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index e9709d70a..2297125d3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -374,6 +374,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index fb44268ca..8481e9bd9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -369,6 +369,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 9c38265c7..a6828a031 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -351,6 +351,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go index 3ca814f54..1157b06d8 100644 --- a/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/vendor/golang.org/x/sys/windows/dll_windows.go @@ -163,42 +163,7 @@ func (p *Proc) Addr() uintptr { // (according to the semantics of the specific function being called) before consulting // the error. The error will be guaranteed to contain windows.Errno. func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { - switch len(a) { - case 0: - return syscall.Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0) - case 1: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], 0, 0) - case 2: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], 0) - case 3: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], a[2]) - case 4: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0) - case 5: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0) - case 6: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5]) - case 7: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0) - case 8: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0) - case 9: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]) - case 10: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], 0, 0) - case 11: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0) - case 12: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11]) - case 13: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0) - case 14: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0) - case 15: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14]) - default: - panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".") - } + return syscall.SyscallN(p.Addr(), a...) } // A LazyDLL implements access to a single DLL. diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index a8b0364c7..6c955cea1 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1438,13 +1438,17 @@ func GetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati } // GetNamedSecurityInfo queries the security information for a given named object and returns the self-relative security -// descriptor result on the Go heap. +// descriptor result on the Go heap. The security descriptor might be nil, even when err is nil, if the object exists +// but has no security descriptor. func GetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION) (sd *SECURITY_DESCRIPTOR, err error) { var winHeapSD *SECURITY_DESCRIPTOR err = getNamedSecurityInfo(objectName, objectType, securityInformation, nil, nil, nil, nil, &winHeapSD) if err != nil { return } + if winHeapSD == nil { + return nil, nil + } defer LocalFree(Handle(unsafe.Pointer(winHeapSD))) return winHeapSD.copySelfRelativeSecurityDescriptor(), nil } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index d76643658..9755bca9f 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -452,6 +452,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys RtlInitString(destinationString *NTString, sourceString *byte) = ntdll.RtlInitString //sys NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) = ntdll.NtCreateFile //sys NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) = ntdll.NtCreateNamedPipeFile +//sys NtQueryInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtQueryInformationFile //sys NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtSetInformationFile //sys RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToNtPathName_U_WithStatus //sys RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToRelativeNtPathName_U_WithStatus @@ -460,6 +461,8 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) = ntdll.NtSetInformationProcess //sys NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQuerySystemInformation //sys NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) = ntdll.NtSetSystemInformation +//sys NtQueryEaFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, returnSingleEntry bool, eaList *byte, eaListLen uint32, eaIndex *uint32, restartScan bool) (ntstatus error) = ntdll.NtQueryEaFile +//sys NtSetEaFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32) (ntstatus error) = ntdll.NtSetEaFile //sys RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) = ntdll.RtlAddFunctionTable //sys RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) = ntdll.RtlDeleteFunctionTable @@ -892,9 +895,13 @@ const socket_error = uintptr(^uint32(0)) //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar //sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx //sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex +//sys GetIfTable2Ex(level uint32, table **MibIfTable2) (errcode error) = iphlpapi.GetIfTable2Ex //sys GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) = iphlpapi.GetIpForwardEntry2 //sys GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) = iphlpapi.GetIpForwardTable2 +//sys GetIpInterfaceEntry(row *MibIpInterfaceRow) (errcode error) = iphlpapi.GetIpInterfaceEntry +//sys GetIpInterfaceTable(family uint16, table **MibIpInterfaceTable) (errcode error) = iphlpapi.GetIpInterfaceTable //sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry +//sys GetUnicastIpAddressTable(family uint16, table **MibUnicastIpAddressTable) (errcode error) = iphlpapi.GetUnicastIpAddressTable //sys FreeMibTable(memory unsafe.Pointer) = iphlpapi.FreeMibTable //sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange //sys NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyRouteChange2 @@ -1693,10 +1700,13 @@ func NewNTUnicodeString(s string) (*NTUnicodeString, error) { if err != nil { return nil, err } - n := uint16(len(s16) * 2) + n := len(s16) * 2 + if n > (1<<16)-1 { + return nil, syscall.EINVAL + } return &NTUnicodeString{ - Length: n - 2, // subtract 2 bytes for the NULL terminator - MaximumLength: n, + Length: uint16(n) - 2, // subtract 2 bytes for the NULL terminator + MaximumLength: uint16(n), Buffer: &s16[0], }, nil } diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index d5658a138..d2574a73e 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -2320,6 +2320,21 @@ type MibIfRow2 struct { OutQLen uint64 } +// MIB_IF_TABLE_LEVEL enumeration from netioapi.h or +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ne-netioapi-mib_if_table_level. +const ( + MibIfTableNormal = 0 + MibIfTableRaw = 1 + MibIfTableNormalWithoutStatistics = 2 +) + +// MibIfTable2 contains a table of logical and physical interface entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_if_table2. +type MibIfTable2 struct { + NumEntries uint32 + Table [1]MibIfRow2 +} + // IP_ADDRESS_PREFIX stores an IP address prefix. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-ip_address_prefix. type IpAddressPrefix struct { @@ -2413,6 +2428,13 @@ type MibUnicastIpAddressRow struct { CreationTimeStamp Filetime } +// MibUnicastIpAddressTable contains a table of unicast IP address entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_table. +type MibUnicastIpAddressTable struct { + NumEntries uint32 + Table [1]MibUnicastIpAddressRow +} + const ScopeLevelCount = 16 // MIB_IPINTERFACE_ROW stores interface management information for a particular IP address family on a network interface. @@ -2455,6 +2477,13 @@ type MibIpInterfaceRow struct { DisableDefaultRoutes uint8 } +// MibIpInterfaceTable contains a table of IP interface entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipinterface_table. +type MibIpInterfaceTable struct { + NumEntries uint32 + Table [1]MibIpInterfaceRow +} + // Console related constants used for the mode parameter to SetConsoleMode. See // https://docs.microsoft.com/en-us/windows/console/setconsolemode for details. @@ -3014,8 +3043,10 @@ const ( ) const ( - // FileInformationClass for NtSetInformationFile + // FileInformationClass for NtSetInformationFile/NtQueryInformationFile, see + // https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ne-wdm-_file_information_class FileBasicInformation = 4 + FileEaInformation = 7 FileRenameInformation = 10 FileDispositionInformation = 13 FilePositionInformation = 14 diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index fe7a4ea12..192d19300 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -188,9 +188,13 @@ var ( procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex") + procGetIfTable2Ex = modiphlpapi.NewProc("GetIfTable2Ex") procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2") procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2") + procGetIpInterfaceEntry = modiphlpapi.NewProc("GetIpInterfaceEntry") + procGetIpInterfaceTable = modiphlpapi.NewProc("GetIpInterfaceTable") procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry") + procGetUnicastIpAddressTable = modiphlpapi.NewProc("GetUnicastIpAddressTable") procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange") procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2") procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange") @@ -424,8 +428,11 @@ var ( procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") + procNtQueryEaFile = modntdll.NewProc("NtQueryEaFile") + procNtQueryInformationFile = modntdll.NewProc("NtQueryInformationFile") procNtQueryInformationProcess = modntdll.NewProc("NtQueryInformationProcess") procNtQuerySystemInformation = modntdll.NewProc("NtQuerySystemInformation") + procNtSetEaFile = modntdll.NewProc("NtSetEaFile") procNtSetInformationFile = modntdll.NewProc("NtSetInformationFile") procNtSetInformationProcess = modntdll.NewProc("NtSetInformationProcess") procNtSetSystemInformation = modntdll.NewProc("NtSetSystemInformation") @@ -1674,6 +1681,14 @@ func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { return } +func GetIfTable2Ex(level uint32, table **MibIfTable2) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIfTable2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(table))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { @@ -1690,6 +1705,22 @@ func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode erro return } +func GetIpInterfaceEntry(row *MibIpInterfaceRow) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpInterfaceEntry.Addr(), uintptr(unsafe.Pointer(row))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + +func GetIpInterfaceTable(family uint16, table **MibIpInterfaceTable) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpInterfaceTable.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { @@ -1698,6 +1729,14 @@ func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { return } +func GetUnicastIpAddressTable(family uint16, table **MibUnicastIpAddressTable) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressTable.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { var _p0 uint32 if initialNotification { @@ -3704,6 +3743,30 @@ func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, i return } +func NtQueryEaFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, returnSingleEntry bool, eaList *byte, eaListLen uint32, eaIndex *uint32, restartScan bool) (ntstatus error) { + var _p0 uint32 + if returnSingleEntry { + _p0 = 1 + } + var _p1 uint32 + if restartScan { + _p1 = 1 + } + r0, _, _ := syscall.SyscallN(procNtQueryEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), uintptr(_p0), uintptr(unsafe.Pointer(eaList)), uintptr(eaListLen), uintptr(unsafe.Pointer(eaIndex)), uintptr(_p1)) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func NtQueryInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, class uint32) (ntstatus error) { + r0, _, _ := syscall.SyscallN(procNtQueryInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), uintptr(class)) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { @@ -3720,6 +3783,14 @@ func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInf return } +func NtSetEaFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32) (ntstatus error) { + r0, _, _ := syscall.SyscallN(procNtSetEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class)) if r0 != 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt index add694766..73e307a99 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -42,18 +42,21 @@ github.com/die-net/lrucache # github.com/golang-jwt/jwt/v4 v4.5.2 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 -# github.com/google/go-github/v82 v82.0.0 -## explicit; go 1.24.0 -github.com/google/go-github/v82/github # github.com/google/go-github/v84 v84.0.0 ## explicit; go 1.25.0 github.com/google/go-github/v84/github +# github.com/google/go-github/v85 v85.0.0 +## explicit; go 1.25.0 +github.com/google/go-github/v85/github # github.com/google/go-querystring v1.2.0 ## explicit; go 1.13 github.com/google/go-querystring/query # github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 ## explicit github.com/gregjones/httpcache +# github.com/hairyhenderson/go-codeowners v0.7.0 +## explicit; go 1.22.0 +github.com/hairyhenderson/go-codeowners # github.com/hashicorp/golang-lru v1.0.2 ## explicit; go 1.12 github.com/hashicorp/golang-lru @@ -61,26 +64,24 @@ github.com/hashicorp/golang-lru/simplelru # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap -# github.com/kr/text v0.2.0 -## explicit # github.com/mattn/go-colorable v0.1.14 ## explicit; go 1.18 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.20 -## explicit; go 1.15 +# github.com/mattn/go-isatty v0.0.22 +## explicit; go 1.21 github.com/mattn/go-isatty # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/palantir/go-baseapp v0.6.0 -## explicit; go 1.24.0 +# github.com/palantir/go-baseapp v0.7.0 +## explicit; go 1.26.0 github.com/palantir/go-baseapp/appmetrics/emitter/datadog github.com/palantir/go-baseapp/appmetrics/emitter/prometheus github.com/palantir/go-baseapp/baseapp github.com/palantir/go-baseapp/baseapp/datadog github.com/palantir/go-baseapp/pkg/errfmt -# github.com/palantir/go-githubapp v0.41.0 -## explicit; go 1.25.0 +# github.com/palantir/go-githubapp v0.44.0 +## explicit; go 1.26.0 github.com/palantir/go-githubapp/appconfig github.com/palantir/go-githubapp/githubapp github.com/palantir/go-githubapp/oauth2 @@ -119,7 +120,7 @@ github.com/rcrowley/go-metrics # github.com/rs/xid v1.6.0 ## explicit; go 1.16 github.com/rs/xid -# github.com/rs/zerolog v1.35.0 +# github.com/rs/zerolog v1.35.1 ## explicit; go 1.23 github.com/rs/zerolog github.com/rs/zerolog/hlog @@ -163,7 +164,7 @@ goji.io goji.io/internal goji.io/pat goji.io/pattern -# golang.org/x/crypto v0.49.0 +# golang.org/x/crypto v0.52.0 ## explicit; go 1.25.0 golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 @@ -173,7 +174,7 @@ golang.org/x/crypto/salsa20/salsa ## explicit; go 1.25.0 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sys v0.42.0 +# golang.org/x/sys v0.45.0 ## explicit; go 1.25.0 golang.org/x/sys/cpu golang.org/x/sys/unix diff --git a/yarn.lock b/yarn.lock index fc7d3893d..1e1ec16d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,10 +29,10 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@colordx/core@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@colordx/core/-/core-5.0.2.tgz#1a6ee0ac0e86c4cc45775bd36778e430163cbde9" - integrity sha512-rQAOi9QmDymEbs021rstydG9qaskMVnf4f8fY37dWbsrdyWJ+yYSJmXYILrtZNJulIu5ju5M9jsQRde9LRNBSw== +"@colordx/core@^5.2.0": + version "5.4.3" + resolved "https://registry.yarnpkg.com/@colordx/core/-/core-5.4.3.tgz#35a8d239b324a6cdf9a16de9970a32c8abc24824" + integrity sha512-kIxYSfA5T8HXjav55UaaH/o/cKivF6jCCGIb8eqtcsfI46wsvlSiT8jMDyrl779qLec3c2c2oHBZo4oAhvbjrQ== "@discoveryjs/json-ext@^1.0.0": version "1.0.0" @@ -396,13 +396,13 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -autoprefixer@^10.4.27: - version "10.4.27" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.27.tgz#51ea301a5c3c5f8642f8e564759c4f573be486f2" - integrity sha512-NP9APE+tO+LuJGn7/9+cohklunJsXWiaWEfV3si4Gi/XHDwVNgkwr1J3RQYFIvPy76GmJ9/bW8vyoU1LcxwKHA== +autoprefixer@^10.5.0: + version "10.5.0" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.5.0.tgz#33d87e443430f020a0f85319d6ff1593cb291be9" + integrity sha512-FMhOoZV4+qR6aTUALKX2rEqGG+oyATvwBt9IIzVR5rMa2HRWPkxf+P+PAJLD1I/H5/II+HuZcBJYEFBpq39ong== dependencies: - browserslist "^4.28.1" - caniuse-lite "^1.0.30001774" + browserslist "^4.28.2" + caniuse-lite "^1.0.30001787" fraction.js "^5.3.4" picocolors "^1.1.1" postcss-value-parser "^4.2.0" @@ -412,10 +412,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -baseline-browser-mapping@^2.9.0: - version "2.9.11" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz#53724708c8db5f97206517ecfe362dbe5181deea" - integrity sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ== +baseline-browser-mapping@^2.10.12: + version "2.10.25" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.25.tgz#183b45c0d3bdd12addb352426555fb3627eb022a" + integrity sha512-QO/VHsXCQdnzADMfmkeOPvHdIAkoB7i0/rGjINPJEetLx75hNttVWGQ/jycHUDP9zZ9rupbm60WRxcwViB0MiA== binary-extensions@^2.0.0: version "2.3.0" @@ -441,16 +441,16 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -browserslist@^4.0.0, browserslist@^4.24.5, browserslist@^4.28.1: - version "4.28.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" - integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== +browserslist@^4.0.0, browserslist@^4.28.1, browserslist@^4.28.2: + version "4.28.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.2.tgz#f50b65362ef48974ca9f50b3680566d786b811d2" + integrity sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg== dependencies: - baseline-browser-mapping "^2.9.0" - caniuse-lite "^1.0.30001759" - electron-to-chromium "^1.5.263" - node-releases "^2.0.27" - update-browserslist-db "^1.2.0" + baseline-browser-mapping "^2.10.12" + caniuse-lite "^1.0.30001782" + electron-to-chromium "^1.5.328" + node-releases "^2.0.36" + update-browserslist-db "^1.2.3" buffer-from@^1.0.0: version "1.1.2" @@ -477,10 +477,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001759, caniuse-lite@^1.0.30001774: - version "1.0.30001775" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001775.tgz#9572266e3f7f77efee5deac1efeb4795879d1b7f" - integrity sha512-s3Qv7Lht9zbVKE9XoTyRG6wVDCKdtOFIjBGg3+Yhn6JaytuNKPIjBMTMIY1AnOH3seL5mvF+x33oGAyK3hVt3A== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001782, caniuse-lite@^1.0.30001787: + version "1.0.30001791" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001791.tgz#dfb93d85c40ad380c57123e72e10f3c575786b51" + integrity sha512-yk0l/YSrOnFZk3UROpDLQD9+kC1l4meK/wed583AXrzoarMGJcbRi2Q4RaUYbKxYAsZ8sWmaSa/DsLmdBeI1vQ== chalk@^2.4.2: version "2.4.2" @@ -639,53 +639,53 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^7.0.12: - version "7.0.12" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-7.0.12.tgz#21e29fed4a8697952485995ffeeec20ff58945a4" - integrity sha512-B3Eoouzw/sl2zANI0AL9KbacummJTCww+fkHaDBMZad/xuVx8bUduPLly6hKVQAlrmvYkS1jB1CVQEKm3gn0AA== +cssnano-preset-default@^7.0.15: + version "7.0.15" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-7.0.15.tgz#464501cc908de8a9c18b8a59af36a21e1d955705" + integrity sha512-60kx7lJ40//HA85cIfQXSOJFby2D2V1pOMNHVCxue3KFWCjRzmiQyL9OvI+NAhwUlaojOfF9eK3nGvrJLCBUfQ== dependencies: - browserslist "^4.28.1" + browserslist "^4.28.2" css-declaration-sorter "^7.2.0" - cssnano-utils "^5.0.1" + cssnano-utils "^5.0.2" postcss-calc "^10.1.1" - postcss-colormin "^7.0.7" - postcss-convert-values "^7.0.9" - postcss-discard-comments "^7.0.6" - postcss-discard-duplicates "^7.0.2" - postcss-discard-empty "^7.0.1" - postcss-discard-overridden "^7.0.1" - postcss-merge-longhand "^7.0.5" - postcss-merge-rules "^7.0.8" - postcss-minify-font-values "^7.0.1" - postcss-minify-gradients "^7.0.2" - postcss-minify-params "^7.0.6" - postcss-minify-selectors "^7.0.6" - postcss-normalize-charset "^7.0.1" - postcss-normalize-display-values "^7.0.1" - postcss-normalize-positions "^7.0.1" - postcss-normalize-repeat-style "^7.0.1" - postcss-normalize-string "^7.0.1" - postcss-normalize-timing-functions "^7.0.1" - postcss-normalize-unicode "^7.0.6" - postcss-normalize-url "^7.0.1" - postcss-normalize-whitespace "^7.0.1" - postcss-ordered-values "^7.0.2" - postcss-reduce-initial "^7.0.6" - postcss-reduce-transforms "^7.0.1" - postcss-svgo "^7.1.1" - postcss-unique-selectors "^7.0.5" - -cssnano-utils@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-5.0.1.tgz#f529e9aa0d7930512ca45b9e2ddb8d6b9092eb30" - integrity sha512-ZIP71eQgG9JwjVZsTPSqhc6GHgEr53uJ7tK5///VfyWj6Xp2DBmixWHqJgPno+PqATzn48pL42ww9x5SSGmhZg== + postcss-colormin "^7.0.9" + postcss-convert-values "^7.0.11" + postcss-discard-comments "^7.0.7" + postcss-discard-duplicates "^7.0.3" + postcss-discard-empty "^7.0.2" + postcss-discard-overridden "^7.0.2" + postcss-merge-longhand "^7.0.6" + postcss-merge-rules "^7.0.10" + postcss-minify-font-values "^7.0.2" + postcss-minify-gradients "^7.0.4" + postcss-minify-params "^7.0.8" + postcss-minify-selectors "^7.1.0" + postcss-normalize-charset "^7.0.2" + postcss-normalize-display-values "^7.0.2" + postcss-normalize-positions "^7.0.3" + postcss-normalize-repeat-style "^7.0.3" + postcss-normalize-string "^7.0.2" + postcss-normalize-timing-functions "^7.0.2" + postcss-normalize-unicode "^7.0.8" + postcss-normalize-url "^7.0.2" + postcss-normalize-whitespace "^7.0.2" + postcss-ordered-values "^7.0.3" + postcss-reduce-initial "^7.0.8" + postcss-reduce-transforms "^7.0.2" + postcss-svgo "^7.1.2" + postcss-unique-selectors "^7.0.6" + +cssnano-utils@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-5.0.2.tgz#92939eda38fb934151a8c87bd60764d1a27c5597" + integrity sha512-kt41WLK7FLKfePzPi645Y+/NtW/nNM7Su6nlNUfJyRNW3JcuU3JU7+cWJc+JexTeZ8dRBvFufefdG2XpXkIo0A== cssnano@^7.1: - version "7.1.4" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-7.1.4.tgz#0aa5bb3b481df024ecafd41c4388c06240bb31ec" - integrity sha512-T9PNS7y+5Nc9Qmu9mRONqfxG1RVY7Vuvky0XN6MZ+9hqplesTEwnj9r0ROtVuSwUVfaDhVlavuzWIVLUgm4hkQ== + version "7.1.7" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-7.1.7.tgz#152658ec9d24f080851c3010e61673d539765af7" + integrity sha512-N5LGn/OlhMxDTvKACwUPMzT34SSj1b022pvUAE/Vh6r2WD1aUCbc+QNIP/JjX9VVxebdJWZQ3352Lt4oF7dQ/g== dependencies: - cssnano-preset-default "^7.0.12" + cssnano-preset-default "^7.0.15" lilconfig "^3.1.3" csso@^5.0.5: @@ -740,10 +740,10 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -electron-to-chromium@^1.5.263: - version "1.5.267" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" - integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== +electron-to-chromium@^1.5.328: + version "1.5.348" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.348.tgz#8031cb2cc3a60cc798c94d4f44bfc174d015e844" + integrity sha512-QC2X59nRlycQQMc4ZXjSVBX+tSgJfgRtcrYHbIZLgOV2dCvefoQGegLR7lLXKgpPpSuVmJU19LMzGrSa2C7k3Q== emoji-regex@^8.0.0: version "8.0.0" @@ -1102,7 +1102,7 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: +json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== @@ -1182,17 +1182,10 @@ micromatch@^4.0.8: braces "^3.0.3" picomatch "^2.3.1" -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.27: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" +mime-db@^1.54.0: + version "1.54.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.54.0.tgz#cddb3ee4f9c64530dff640236661d42cb6a314f5" + integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ== mini-css-extract-plugin@^2.10.2: version "2.10.2" @@ -1233,10 +1226,10 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -node-releases@^2.0.27: - version "2.0.27" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" - integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== +node-releases@^2.0.36: + version "2.0.38" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.38.tgz#791569b9e4424a044e12c3abfad418ed83ce9947" + integrity sha512-3qT/88Y3FbH/Kx4szpQQ4HzUbVrHPKTLVpVocKiLfoYvw9XSGOX2FmD2d6DrXbVYyAQTF2HeF6My8jmzx7/CRw== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" @@ -1359,45 +1352,45 @@ postcss-calc@^10.1.1: postcss-selector-parser "^7.0.0" postcss-value-parser "^4.2.0" -postcss-colormin@^7.0.7: - version "7.0.7" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-7.0.7.tgz#63b42eb2a9cfc092b96b1b758db66dc35a2a3f19" - integrity sha512-sBQ628lSj3VQpDquQel8Pen5mmjFPsO4pH9lDLaHB1AVkMRHtkl0pRB5DCWznc9upWsxint/kV+AveSj7W1tew== +postcss-colormin@^7.0.9: + version "7.0.9" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-7.0.9.tgz#688b4f22599c9aedd3126f978580b43a4ced009f" + integrity sha512-EZpoUlmbXQUpe+g4ZaGM2kjGlHrQ7Bjzb3xHcNrC9ysI1tGoib6DAYvxg6aB7MGxsjgLF+Qx/jwZQkJ5cKDvXA== dependencies: - "@colordx/core" "^5.0.0" - browserslist "^4.28.1" + "@colordx/core" "^5.2.0" + browserslist "^4.28.2" caniuse-api "^3.0.0" postcss-value-parser "^4.2.0" -postcss-convert-values@^7.0.9: - version "7.0.9" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-7.0.9.tgz#6ada5c2c480f1ddbd4c886339025a916ecc8ff01" - integrity sha512-l6uATQATZaCa0bckHV+r6dLXfWtUBKXxO3jK+AtxxJJtgMPD+VhhPCCx51I4/5w8U5uHV67g3w7PXj+V3wlMlg== +postcss-convert-values@^7.0.11: + version "7.0.11" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-7.0.11.tgz#d13c80e74732d841894ba315410bfaae9be79545" + integrity sha512-H+s7P0f9jJylSysAHs3/5MhAx7GthDO05uw1h56L2xyEqpiLTFLEqBNw3PUYzD5p/AKwWaigCXf6FGELpOw9lw== dependencies: - browserslist "^4.28.1" + browserslist "^4.28.2" postcss-value-parser "^4.2.0" -postcss-discard-comments@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-7.0.6.tgz#4e9c696a83391d90b3ffa4485ac144e555db443c" - integrity sha512-Sq+Fzj1Eg5/CPf1ERb0wS1Im5cvE2gDXCE+si4HCn1sf+jpQZxDI4DXEp8t77B/ImzDceWE2ebJQFXdqZ6GRJw== +postcss-discard-comments@^7.0.7: + version "7.0.7" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-7.0.7.tgz#6e8226e8e818e37a98c7b6af5c66aa7b730e0d17" + integrity sha512-FJhE3fSte7HaRNL4iwD8LTG9vWqj3puxXIdig6LfrFqc1TJRUhY4kXOkeTXZZfTXYny+k+SO7fd2fymj1wduJg== dependencies: postcss-selector-parser "^7.1.1" -postcss-discard-duplicates@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-7.0.2.tgz#9cf3e659d4f94b046eef6f93679490c0250a8e4e" - integrity sha512-eTonaQvPZ/3i1ASDHOKkYwAybiM45zFIc7KXils4mQmHLqIswXD9XNOKEVxtTFnsmwYzF66u4LMgSr0abDlh5w== +postcss-discard-duplicates@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-7.0.3.tgz#4a1c51219a1f347838744829db1064deb0758770" + integrity sha512-9cRxXwhEM/aNZon1qZyToX4NmjbFbxOGbww+0CnbYFDbbPRGZ8jg4IbM8UlA+CzkXxM35itxyaHKNqBBg/RTDg== -postcss-discard-empty@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-7.0.1.tgz#b6c57e8b5c69023169abea30dceb93f98a2ffd9f" - integrity sha512-cFrJKZvcg/uxB6Ijr4l6qmn3pXQBna9zyrPC+sK0zjbkDUZew+6xDltSF7OeB7rAtzaaMVYSdbod+sZOCWnMOg== +postcss-discard-empty@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-7.0.2.tgz#4af6e7cb088ef807564a7e60bfe8db32feb8abcd" + integrity sha512-NZFouOmOwtngJVgkNeI1LtkzFdYqIurxgy4wq3qNvIiXFURTZ3b/K7q3dP3QitlWQ5imHDQL0qSorItQhoxb1g== -postcss-discard-overridden@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-7.0.1.tgz#bd9c9bc5e4548d3b6e67e7f8d64f2c9d745ae2a0" - integrity sha512-7c3MMjjSZ/qYrx3uc1940GSOzN1Iqjtlqe8uoSg+qdVPYyRb0TILSqqmtlSFuE4mTDECwsm397Ya7iXGzfF7lg== +postcss-discard-overridden@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-7.0.2.tgz#aa12b18fa1f2dc7e6d6e51fe062ed839639329c0" + integrity sha512-Ym01X4v6U3sY8X0P1J9P+RTar+7JyLTOzDrxKSeaArFsLmkVu4KcAKPBWDYRIyZ/q4jwpSPnOnekeSSqXSXKUw== postcss-import@^15.1.0: version "15.1.0" @@ -1431,54 +1424,56 @@ postcss-loader@^8.2.1: jiti "^2.5.1" semver "^7.6.2" -postcss-merge-longhand@^7.0.5: - version "7.0.5" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-7.0.5.tgz#e1b126e92f583815482e8b1e82c47d2435a20421" - integrity sha512-Kpu5v4Ys6QI59FxmxtNB/iHUVDn9Y9sYw66D6+SZoIk4QTz1prC4aYkhIESu+ieG1iylod1f8MILMs1Em3mmIw== +postcss-merge-longhand@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-7.0.6.tgz#b24f1dfb297b1ae6d1ba33aa88176b23c2069d3c" + integrity sha512-lDsWeKRsssX/9vKFpingoRiuvGajtOGCJhs1kyaTJ5fzaVzs0aPPYe38UZ/ukMFEA5iuRIjQJHIkH2niYO3ubQ== dependencies: postcss-value-parser "^4.2.0" - stylehacks "^7.0.5" + stylehacks "^7.0.10" -postcss-merge-rules@^7.0.8: - version "7.0.8" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-7.0.8.tgz#d63ce875b9f7880ca4aa89d9ae3eaa3657215f82" - integrity sha512-BOR1iAM8jnr7zoQSlpeBmCsWV5Uudi/+5j7k05D0O/WP3+OFMPD86c1j/20xiuRtyt45bhxw/7hnhZNhW2mNFA== +postcss-merge-rules@^7.0.10: + version "7.0.10" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-7.0.10.tgz#6b8d2c1e0fa72cf5c045356610c86108eb5af397" + integrity sha512-UXYKxkg8Cy1so/evF7AE/25PNXZb3E0SrvjdbtbGf+MW+doLenKqRLQzz6YZW469ktiXK2MVLFWtel/DftCV0Q== dependencies: - browserslist "^4.28.1" + browserslist "^4.28.2" caniuse-api "^3.0.0" - cssnano-utils "^5.0.1" + cssnano-utils "^5.0.2" postcss-selector-parser "^7.1.1" -postcss-minify-font-values@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-7.0.1.tgz#6fb4770131b31fd5a2014bd84e32f386a3406664" - integrity sha512-2m1uiuJeTplll+tq4ENOQSzB8LRnSUChBv7oSyFLsJRtUgAAJGP6LLz0/8lkinTgxrmJSPOEhgY1bMXOQ4ZXhQ== +postcss-minify-font-values@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-7.0.2.tgz#8d831d8ddfe75d5062451d56f10d36a31e5cbea3" + integrity sha512-Z82NUmnvhPrvMUaHfkaAVBmWQq9F8Dox4Dy0LiwbaTxfmDUWLQtS+0WCgKViwdWCPPajiY9YzoQftgqKdXkM5g== dependencies: postcss-value-parser "^4.2.0" -postcss-minify-gradients@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-7.0.2.tgz#7937c8dcbd847f6cfd5b16938500587af8882fea" - integrity sha512-fVY3AB8Um7SJR5usHqTY2Ngf9qh8IRN+FFzrBP0ONJy6yYXsP7xyjK2BvSAIrpgs1cST+H91V0TXi3diHLYJtw== +postcss-minify-gradients@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-7.0.4.tgz#145615c2382e9c26e780a483b3ee0939688419b5" + integrity sha512-g8MNeNyN+lbwKy8DCtJ6zU6awBL0InBsSOaKmgZ1MdRLVItLQUNFNAzzzBnOp4qowOcyyB6GetTlQ0/0UNXvag== dependencies: - "@colordx/core" "^5.0.0" - cssnano-utils "^5.0.1" + "@colordx/core" "^5.2.0" + cssnano-utils "^5.0.2" postcss-value-parser "^4.2.0" -postcss-minify-params@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-7.0.6.tgz#ca0df1bd4eaa70ee7a4ee17f393d275988f44657" - integrity sha512-YOn02gC68JijlaXVuKvFSCvQOhTpblkcfDre2hb/Aaa58r2BIaK4AtE/cyZf2wV7YKAG+UlP9DT+By0ry1E4VQ== +postcss-minify-params@^7.0.8: + version "7.0.8" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-7.0.8.tgz#5d7f6e303bbf23ebc68899c0b1443a30cc4321d6" + integrity sha512-DIUKM5DZGTmxN7KFKT+rxt0FdPDmRrdK/k3n3+6Po+N/QYn06juwagHcfOVBG0CfCHwcnI612GAUCZc3eT+ZEg== dependencies: - browserslist "^4.28.1" - cssnano-utils "^5.0.1" + browserslist "^4.28.2" + cssnano-utils "^5.0.2" postcss-value-parser "^4.2.0" -postcss-minify-selectors@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-7.0.6.tgz#1e0240e1fa3372d81d3f0586591f1e8d2ae21e16" - integrity sha512-lIbC0jy3AAwDxEgciZlBullDiMBeBCT+fz5G8RcA9MWqh/hfUkpOI3vNDUNEZHgokaoiv0juB9Y8fGcON7rU/A== +postcss-minify-selectors@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-7.1.0.tgz#578e2ab5fb1b5156c4f18d7d64861ff656fd0aea" + integrity sha512-HYl/6I0aL+UvpA10t65BSa7h+tVjBgE6oRI5N/3ylX3vtwvlDL67G3FT3vYDPnTksxr0riiyJcT0tBtyRVoloA== dependencies: + browserslist "^4.28.1" + caniuse-api "^3.0.0" cssesc "^3.0.0" postcss-selector-parser "^7.1.1" @@ -1517,88 +1512,88 @@ postcss-nested@^6.2.0: dependencies: postcss-selector-parser "^6.1.1" -postcss-normalize-charset@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-7.0.1.tgz#bccc3f7c5f4440883608eea8b444c8f41ce55ff6" - integrity sha512-sn413ofhSQHlZFae//m9FTOfkmiZ+YQXsbosqOWRiVQncU2BA3daX3n0VF3cG6rGLSFVc5Di/yns0dFfh8NFgQ== +postcss-normalize-charset@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-7.0.2.tgz#0d0b39ea2df240af4985f31ffa47690679a7a9a5" + integrity sha512-YoINoiR4YKlzfB95Y93b0DSxWy7FLw+1SADIaznMHb88AKizpzfF80tolmiDEbYr1UM4r4Hw+NZq37SwT5f3uw== -postcss-normalize-display-values@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-7.0.1.tgz#feb40277d89a7f677b67a84cac999f0306e38235" - integrity sha512-E5nnB26XjSYz/mGITm6JgiDpAbVuAkzXwLzRZtts19jHDUBFxZ0BkXAehy0uimrOjYJbocby4FVswA/5noOxrQ== +postcss-normalize-display-values@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-7.0.2.tgz#a90f6ec503b2c6441f04040108c5a123d7e0abe1" + integrity sha512-wu/NTSjnp8sX5TnEHVPN+eScjAtRs18ELtEduG+Ek3GxjeUDUT+VAA3PJjVIXBcVIk6fiLYFj2iKH0q99S3T2Q== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-positions@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-7.0.1.tgz#c771c0d33034455205f060b999d8557c2308d22c" - integrity sha512-pB/SzrIP2l50ZIYu+yQZyMNmnAcwyYb9R1fVWPRxm4zcUFCY2ign7rcntGFuMXDdd9L2pPNUgoODDk91PzRZuQ== +postcss-normalize-positions@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-7.0.3.tgz#79d185099da6d06b0eb417908e1564ba97082594" + integrity sha512-1CJI++oA3yK/fQlPUcEngUfcSWS08Pkt9fK+jVgL53mmtHDBHi0YiuB0m3D9BXwZjmfvCc2GQmFqCAF/CVcPzQ== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-repeat-style@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-7.0.1.tgz#05fe4d838eedbd996436c5cab78feef9bb1ae57b" - integrity sha512-NsSQJ8zj8TIDiF0ig44Byo3Jk9e4gNt9x2VIlJudnQQ5DhWAHJPF4Tr1ITwyHio2BUi/I6Iv0HRO7beHYOloYQ== +postcss-normalize-repeat-style@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-7.0.3.tgz#479c79c371d685533c73ef491d7adf9a9759e74c" + integrity sha512-RvImJ2Ml4LZSx31qC2C8LDiz65IgBNATtwEr9r3Aue+D0cCGbj4rjNojb/uGpEm4QxnOTzFqMvaDYuKiT1Cmpg== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-string@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-7.0.1.tgz#0f111e7b5dfb6de6ab19f09d9e1c16fabeee232f" - integrity sha512-QByrI7hAhsoze992kpbMlJSbZ8FuCEc1OT9EFbZ6HldXNpsdpZr+YXC5di3UEv0+jeZlHbZcoCADgb7a+lPmmQ== +postcss-normalize-string@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-7.0.2.tgz#a2d2111f320b88fa859212867beb8dd1f5f9e8c0" + integrity sha512-FqtrUh2BU2MnVeLeWBbJ2rwOjuDnA91XvoImc1BbgMWIxdxiPTaquflBHsmFBA3xh3pC3wPZO9W5MaIc7wU/Xw== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-timing-functions@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-7.0.1.tgz#7b645a36f113fec49d95d56386c9980316c71216" - integrity sha512-bHifyuuSNdKKsnNJ0s8fmfLMlvsQwYVxIoUBnowIVl2ZAdrkYQNGVB4RxjfpvkMjipqvbz0u7feBZybkl/6NJg== +postcss-normalize-timing-functions@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-7.0.2.tgz#50b5b10f99f05bc1d920c6ff471f2ab9794b3fbf" + integrity sha512-5H5fpXBnMACEXzn7k9RP7qWZ1eWg8cuZkUuFygStY7icOj+UucwMWXeMmdkF/iITvTVa7fP85tdRCJeznpdFfQ== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-unicode@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-7.0.6.tgz#6935d6baf7f7374a34c216a7fe13229acd1073f2" - integrity sha512-z6bwTV84YW6ZvvNoaNLuzRW4/uWxDKYI1iIDrzk6D2YTL7hICApy+Q1LP6vBEsljX8FM7YSuV9qI79XESd4ddQ== +postcss-normalize-unicode@^7.0.8: + version "7.0.8" + resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-7.0.8.tgz#315b2f008aa4a94d02de67ec84d9e9b1cd99f9bf" + integrity sha512-imCM3cwK3hvlAG4z1AzYM24m8BPA3/Jk/S71wfbn2I6+E2b+UwFaGvlNqydihXTSl3OFPeQXztqCzg+NGeSibQ== dependencies: - browserslist "^4.28.1" + browserslist "^4.28.2" postcss-value-parser "^4.2.0" -postcss-normalize-url@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-7.0.1.tgz#d6471a22b6747ce93d7038c16eb9f1ba8b307e25" - integrity sha512-sUcD2cWtyK1AOL/82Fwy1aIVm/wwj5SdZkgZ3QiUzSzQQofrbq15jWJ3BA7Z+yVRwamCjJgZJN0I9IS7c6tgeQ== +postcss-normalize-url@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-7.0.2.tgz#5d530aa724a31cfd6b68b904eb542fd1af9cb7d3" + integrity sha512-bLnNY7t76NLRb9QQyCVmCN4qwoHxiq6vABH/CXav9wTuR6dNGHGQ72AyO/+h2quWxZk3l7BqxNL1vtDi9H6y1g== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-whitespace@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-7.0.1.tgz#ab8e9ff1f3213f3f3851c0a7d0e4ce4716777cea" - integrity sha512-vsbgFHMFQrJBJKrUFJNZ2pgBeBkC2IvvoHjz1to0/0Xk7sII24T0qFOiJzG6Fu3zJoq/0yI4rKWi7WhApW+EFA== +postcss-normalize-whitespace@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-7.0.2.tgz#eb91bdb73f04570e4fb7055493e61b5aedd69fb7" + integrity sha512-TNSVkuhkeOhl36WruQlflxOb7HweoeZowSusNpfsM1+ZvqJ24Mc+xksu05ecMQxlu+0zgI8pyznO2EWqDCQbLA== dependencies: postcss-value-parser "^4.2.0" -postcss-ordered-values@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-7.0.2.tgz#0e803fbb9601e254270481772252de9a8c905f48" - integrity sha512-AMJjt1ECBffF7CEON/Y0rekRLS6KsePU6PRP08UqYW4UGFRnTXNrByUzYK1h8AC7UWTZdQ9O3Oq9kFIhm0SFEw== +postcss-ordered-values@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-7.0.3.tgz#8ad4cc375b9258904f88eefbfe6a9f13f3fe31b7" + integrity sha512-FTt6R9RF7NAYfpOHa2XFPm89FVuo5GiIbcfwOXFy1MYF38BeiNW9ke8ybw9Pk62eEsUlRVVbxHWA3B7ERYqOOA== dependencies: - cssnano-utils "^5.0.1" + cssnano-utils "^5.0.2" postcss-value-parser "^4.2.0" -postcss-reduce-initial@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-7.0.6.tgz#fa3af45e60cd04d9a3d29315eb97c82b7b447ead" - integrity sha512-G6ZyK68AmrPdMB6wyeA37ejnnRG2S8xinJrZJnOv+IaRKf6koPAVbQsiC7MfkmXaGmF1UO+QCijb27wfpxuRNg== +postcss-reduce-initial@^7.0.8: + version "7.0.8" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-7.0.8.tgz#81a3ac97722d55f415cbd18736e596b2fc9330e4" + integrity sha512-VeVRmbgpgTZuRcDQdqnsB4iYTeS2dBRV07UdwK6V3x61F1xTQ2pgIzHBIR4rQYRlXRNKBTGYYhEL1eNA7w9vaQ== dependencies: - browserslist "^4.28.1" + browserslist "^4.28.2" caniuse-api "^3.0.0" -postcss-reduce-transforms@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-7.0.1.tgz#f87111264b0dfa07e1f708d7e6401578707be5d6" - integrity sha512-MhyEbfrm+Mlp/36hvZ9mT9DaO7dbncU0CvWI8V93LRkY6IYlu38OPg3FObnuKTUxJ4qA8HpurdQOo5CyqqO76g== +postcss-reduce-transforms@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-7.0.2.tgz#f40d635a56f6417c7e02bbebb0bf082d4f84d988" + integrity sha512-OV5P9hMnf7kEkeXVXyS5ESqxbIls7a3TqFymUAV5JICO/9YCBEU+QQhQjZiDHaLwFdV7/CL481kVeBUk5FdY3w== dependencies: postcss-value-parser "^4.2.0" @@ -1628,7 +1623,7 @@ postcss-selector-parser@^6.1.1, postcss-selector-parser@^6.1.2: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-selector-parser@^7.0.0, postcss-selector-parser@^7.1.0: +postcss-selector-parser@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz#4d6af97eba65d73bc4d84bcb343e865d7dd16262" integrity sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA== @@ -1644,18 +1639,18 @@ postcss-selector-parser@^7.1.1: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-svgo@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-7.1.1.tgz#14b90fd2a1b1f27bcb2d0ef0444f954237e7883c" - integrity sha512-zU9H9oEDrUFKa0JB7w+IYL7Qs9ey1mZyjhbf0KLxwJDdDRtoPvCmaEfknzqfHj44QS9VD6c5sJnBAVYTLRg/Sg== +postcss-svgo@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-7.1.2.tgz#67ffebb2910523cba32188732bbe8d8095bda9c2" + integrity sha512-ixExc8m+/68yuSYQzV/1DgtTup/7nI2dN9eiDS5GMRUzeCH4q9UcqeZPwcSVhdf8ay9fRwXDUHwcY5/XzQSszQ== dependencies: postcss-value-parser "^4.2.0" svgo "^4.0.1" -postcss-unique-selectors@^7.0.5: - version "7.0.5" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-7.0.5.tgz#a7dd5652c95f459176e5f135c021473e4ee58874" - integrity sha512-3QoYmEt4qg/rUWDn6Tc8+ZVPmbp4G1hXDtCNWDx0st8SjtCbRcxRXDDM1QrEiXGG3A45zscSJFb4QH90LViyxg== +postcss-unique-selectors@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-7.0.6.tgz#fdbb14c57ebb3afa4b79c086841cf23e7d1473b6" + integrity sha512-cDxnYw1QuBMW5w3svZ0BlYF0IA4Amr+1JoTLXzu6vDFPNwohN2QU+sPZNx15b930LR7ce+/600h28/cYoxO9vw== dependencies: postcss-selector-parser "^7.1.1" @@ -1665,9 +1660,9 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.1.0, postcss-value-parser@^ integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.4.40, postcss@^8.4.47, postcss@^8.5: - version "8.5.8" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.8.tgz#6230ecc8fb02e7a0f6982e53990937857e13f399" - integrity sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg== + version "8.5.13" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.13.tgz#6cfaf647f2e7ef69850208eccd849e0d3f65d420" + integrity sha512-qif0+jGGZoLWdHey3UFHHWP0H7Gbmsk8T5VEqyYFbWqPr1XqvLGBbk/sl8V5exGmcYJklJOhOQq1pV9IcsiFag== dependencies: nanoid "^3.3.11" picocolors "^1.1.1" @@ -1866,13 +1861,13 @@ strip-ansi@^7.0.1: dependencies: ansi-regex "^6.0.1" -stylehacks@^7.0.5: - version "7.0.5" - resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-7.0.5.tgz#86985a8c810f88e4a1a34804b0fe350686457ca9" - integrity sha512-5kNb7V37BNf0Q3w+1pxfa+oiNPS++/b4Jil9e/kPDgrk1zjEd6uR7SZeJiYaLYH6RRSC1XX2/37OTeU/4FvuIA== +stylehacks@^7.0.10: + version "7.0.10" + resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-7.0.10.tgz#1fdeab7bb40c85074e60286f8053700d9d7436cc" + integrity sha512-sRJ7klmhe/Fl5woJcbJUa2qP1Ueffsl1CQI4ePvqXLkZmcIuAt09aP9uT/FOFPqXh9Rh8M5UkgEnwTdTKn/Aag== dependencies: - browserslist "^4.24.5" - postcss-selector-parser "^7.1.0" + browserslist "^4.28.2" + postcss-selector-parser "^7.1.1" sucrase@^3.35.0: version "3.35.0" @@ -2008,7 +2003,7 @@ uniq@^1.0.1: resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= -update-browserslist-db@^1.2.0: +update-browserslist-db@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== @@ -2073,10 +2068,10 @@ webpack-sources@^3.3.3, webpack-sources@^3.3.4: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.4.tgz#a338b95eb484ecc75fbb196cbe8a2890618b4891" integrity sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q== -webpack@^5.105.4: - version "5.105.4" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.105.4.tgz#1b77fcd55a985ac7ca9de80a746caffa38220169" - integrity sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw== +webpack@^5.106.2: + version "5.106.2" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.106.2.tgz#ca8174b4fd80f055cc5a45fcc5577d6db76c8ac5" + integrity sha512-wGN3qcrBQIFmQ/c0AiOAQBvrZ5lmY8vbbMv4Mxfgzqd/B6+9pXtLo73WuS1dSGXM5QYY3hZnIbvx+K1xxe6FyA== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -2094,9 +2089,8 @@ webpack@^5.105.4: events "^3.2.0" glob-to-regexp "^0.4.1" graceful-fs "^4.2.11" - json-parse-even-better-errors "^2.3.1" loader-runner "^4.3.1" - mime-types "^2.1.27" + mime-db "^1.54.0" neo-async "^2.6.2" schema-utils "^4.3.3" tapable "^2.3.0"